Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Compiler thats works in Windows 7 |
| Date | 2011-10-02 11:20 -0700 |
| Organization | None to speak of |
| Message-ID | <ln4nzrxnjz.fsf@nuthaus.mib.org> (permalink) |
| References | <fcba210d-ee60-491a-8576-633ac475d495@k34g2000yqm.googlegroups.com> <6be0c2d6-1460-486d-b253-f4128609144d@k15g2000yqd.googlegroups.com> |
Nick Keighley <nick_keighley_nospam@hotmail.com> writes:
> On Sep 30, 9:44 am, AK <anoopkamma...@gmail.com> wrote:
>> Its been a really long time since I came back here and the reason is
>> simply that I was working with Java when I started working. Now that I
>> have entered a grad school, I am in the process of returning to C.
>>
>> So, heres the big question. Back in the days when I last used C, I
>> used to use the Bloodshed Dev-C++ IDE that comes(or at-least used to)
>> with the MIngw package. However, things have changed and my new laptop
>> runs Windows 7. So, I am looking for a compiler(preferably an IDE)
>> that I can use as I am re-learning C. I am hoping to get a compiler
>> that sticks to the standards.
>
> which standard. For maximum portability use C89. The latest standard
> is C99 but it isn't so widely supported.
Agreed. On the other hand, many compilers support large subsets of C99,
and a few support essentially all of it.
Your options are:
1. Use only C89/C90. Whatever compiler you're using, invoke it in
strict C90 mode (for gcc: "-ansi -pedantic"; for other compilers, see
their documentation). Avoid writing any code that conflicts with C99;
for example, provide prototypes for all functions (a very good idea
regardless), don't use "inline" or "restrict" as identifiers, and a few
other things. This should give you maximum portability.
*Some* C99-specific features can be implemented (more or less) in C90.
For example, <http://www.lysator.liu.se/c/q8/index.html> is a C90
implementation of C99's <stdint.h>. You can create something that acts
very similarly to C99's "bool" with:
typedef enum { false, true } bool;
(there are subtle differences, but straightforward usage should be ok).
2. Use some, but not all, C99 features. Do some research on all the
compilers your code is likely to be compiled with, and find out what
C99-specific features they support. Consider using
#if __STDC__VERSION >= 199901L
to test for C99 compliance, falling back to C90 when necessary
and possible. Note that if you need to use Microsoft's C compiler,
the subset of C99 you'll be able to use might be very small.
3. Use C99. This will restrict your code to C99-conforming
compilers. As time passes, the set of compilers you can use
*should* increase, but uptake has been disappointingly slow.
Keep an eye on the development of the C201X standard; with luck,
it *might* get better support in the coming years than C99 did.
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf> is the
latest draft. C201X proposes to make some features optional --
including some that are mandatory in C99.
All these options are potentially more complex if you need to use
compiler-specific extensions.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Compiler thats works in Windows 7 AK <anoopkammaran@gmail.com> - 2011-09-30 01:44 -0700
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-09-30 10:54 +0200
Re: Compiler thats works in Windows 7 Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-02 03:01 -0700
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-10-02 12:21 +0200
Re: Compiler thats works in Windows 7 Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-02 05:42 -0700
Re: Compiler thats works in Windows 7 Robert Wessel <robertwessel2@yahoo.com> - 2011-10-02 11:43 -0500
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-10-02 20:11 +0200
Re: Compiler thats works in Windows 7 Robert Wessel <robertwessel2@yahoo.com> - 2011-10-03 00:42 -0500
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-10-03 08:49 +0200
Re: Compiler thats works in Windows 7 Geoff <geoff@invalid.invalid> - 2011-10-03 12:31 -0700
Re: Compiler thats works in Windows 7 Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-03 00:23 -0700
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-10-03 10:33 +0200
Re: Compiler thats works in Windows 7 AK <anoopkammaran@gmail.com> - 2011-10-03 09:29 -0700
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-10-03 18:42 +0200
Re: Compiler thats works in Windows 7 tea strainer <nospam@nospam.com> - 2011-10-05 19:22 +0000
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-10-05 22:08 +0200
Re: Compiler thats works in Windows 7 "James" <no@spam.invalid> - 2011-10-05 13:17 -0700
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-10-05 22:31 +0200
Re: Compiler thats works in Windows 7 AK <anoopkammaran@gmail.com> - 2011-10-05 19:47 -0700
Re: Compiler thats works in Windows 7 Robert Wessel <robertwessel2@yahoo.com> - 2011-10-05 22:57 -0500
Re: Compiler thats works in Windows 7 "James" <no@spam.invalid> - 2011-10-06 00:06 -0700
Re: Compiler thats works in Windows 7 Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-10-06 19:37 +0000
Re: Compiler thats works in Windows 7 Geoff <geoff@invalid.invalid> - 2011-10-05 16:22 -0700
Re: Compiler thats works in Windows 7 gordonb.d74xa@burditt.org (Gordon Burditt) - 2011-10-05 21:16 -0500
Re: Compiler thats works in Windows 7 AK <anoopkammaran@gmail.com> - 2011-10-05 19:50 -0700
Re: Compiler thats works in Windows 7 "James" <no@spam.invalid> - 2011-10-05 21:05 -0700
Re: Compiler thats works in Windows 7 Noob <root@127.0.0.1> - 2011-10-06 10:49 +0200
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-10-06 16:21 +0200
Re: Compiler thats works in Windows 7 Geoff <geoff@invalid.invalid> - 2011-10-02 12:46 -0700
Re: Compiler thats works in Windows 7 Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-03 00:26 -0700
Re: Compiler thats works in Windows 7 Noob <root@127.0.0.1> - 2011-09-30 11:06 +0200
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-09-30 13:03 +0200
Re: Compiler thats works in Windows 7 Karthik Bharadwaj <nomail@fightspam.org> - 2011-09-30 07:41 -0600
Re: Compiler thats works in Windows 7 jacob navia <jacob@spamsink.net> - 2011-09-30 19:11 +0200
Re: Compiler thats works in Windows 7 ImpalerCore <jadill33@gmail.com> - 2011-09-30 08:03 -0700
Re: Compiler thats works in Windows 7 John Gordon <gordon@panix.com> - 2011-09-30 16:18 +0000
Re: Compiler thats works in Windows 7 lawrence.jones@siemens.com - 2011-09-30 14:37 -0400
Re: Compiler thats works in Windows 7 Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-10-02 03:04 -0700
Re: Compiler thats works in Windows 7 Keith Thompson <kst-u@mib.org> - 2011-10-02 11:20 -0700
Re: Compiler thats works in Windows 7 Ian Collins <ian-news@hotmail.com> - 2011-10-03 08:56 +1300
csiph-web