469,281 Members | 2,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,281 developers. It's quick & easy.

Visual C++ Express Edition or lcc-win32?

Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?

Also, is there a C++ compiler akin to lcc-win32?

Thanks,
Nimmi

Sep 2 '07 #1
166 6659
Nimmi Srivastav wrote:
Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?
I've used MS compilers (with various success) from around 1990, and
eventually (unfortunately, only recently) they got quite decent. I
cannot vouch for their C[99] support, but their C++ compliance is
very good. They produce fast code, and the project management in
their IDE is not bad at all.

What's "lcc"?
Also, is there a C++ compiler akin to lcc-win32?
I don't know that, sorry.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Sep 2 '07 #2
"Alf P. Steinbach" <al***@start.nowrites:
* Victor Bazarov:
>What's "lcc"?

Used to be relevant in the 1990's. As I understand it, essentially
one man's opinion on which extensions should really be there in C and
C++. And he implemented it. One must respect that. But I think, now
not so relevant any more.
There's a distinction between lcc and lcc-win32. I'm not clear on the
details; if you're curious, ask in comp.compilers.lcc. (Neither of
the is a C++ compiler, though lcc-win32 implements some C++-like
extensions to C.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 2 '07 #3
Nimmi Srivastav said:
Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32?
A perusal of the comp.lang.c posting history of the latter will induce
you to select the former. But they are not the only two choices -
mingw32 is basically gcc-for-Windows, and is well worth a look. Having
said that, VC++ is a good compiler (at least for C, anyway, and
apparently its C++ conformance has improved in recent years, too, but
the clc++ crowd will correct me on that if I'm mistaken).
Does anyone have any opinion to share?
It is very, very, very, very, very rare for me to recommend a Microsoft
product, but I have occasionally recommended Visual C to people needing
a Windows implementation. And if the only choice is between Emperor
Palpatine and Jar-Jar Binks, what can you do but join the Dark Side?

(But there /are/ other alternatives. See above.)

Also, is there a C++ compiler akin to lcc-win32?
I don't know of any C++ compilers ostensibly written by self-serving
buffoons, but of course it's entirely possible that this is merely
ignorance on my part.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 2 '07 #4
Nimmi Srivastav wrote:
Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?

Also, is there a C++ compiler akin to lcc-win32?

Thanks,
Nimmi
I am the author of lcc-win32. This is a C compiler that implements
the latest standard C99 under windows. There is a 64 bit version
in the works, and there are 64 and 32 bits versions under linux
and AIX.

Language: C99 plus compatible extensions, operator overloading and
generic functions. Other minor extensions like default
arguments are accepted.

Libraries: Supports 100 digits precision floating point, bignums
and 128 bit integers as extended types (using operator
overloading).
Statistics library.
Garbage collector
String library (Using operator overloading) that uses
counted strings and NOT zero terminated ones.
Matrix library.
Environment: IDE, windowed debugger, resource editor, project
management.
Price: Free download. Size: around 5MB. All this is written
in C. Generates very small programs.

Bugs: Only the 32 bit windows version is well tested.
Sep 2 '07 #5
Richard Heathfield wrote:
I don't know of any C++ compilers ostensibly written by self-serving
buffoons, but of course it's entirely possible that this is merely
ignorance on my part.

You can't post anything without insults...

This is nice. You do not have any arguments anymore.

jacob
Sep 2 '07 #6
Victor Bazarov wrote:
Nimmi Srivastav wrote:
>Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?

I've used MS compilers (with various success) from around 1990, and
eventually (unfortunately, only recently) they got quite decent. I
cannot vouch for their C[99] support, but their C++ compliance is
very good. They produce fast code, and the project management in
their IDE is not bad at all.

What's "lcc"?
>Also, is there a C++ compiler akin to lcc-win32?

I don't know that, sorry.

V
Please see my other post in this thread.

Sep 2 '07 #7
On Sat, 01 Sep 2007 17:54:41 -0700, Nimmi Srivastav
<ni*************@yahoo.comwrote:
>Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?
I suggest you try both and make up your own mind. I have (and I prefer
VC++ 2005). As others have mentioned, there are other alternatives,
and you should consider those as well.

In my experience, the more compilers you can compile your code with
the better. C compilers are free to issue diagnostics for anything and
everything. That's not to say that compilers abuse this and emit
diagnostic messages on a whim, even when nothing is wrong with your
code. On the contrary, compilers emit diagnostic warnings for good
reason. And some compilers do it better than others.

Since you asked about compilers running on Windows, I'll tell you that
one of my favorite "compilers" is PC-lint:

http://www.gimpel.com/

Note that PC-lint is not free, so it may not be suitable for a
hobbyist, depending on your definition of a hobbyist.

Best regards
--
jay

P.S.
PC-lint also runs on Linux, provided you run it in a Windows emulator
such as WINE.

P.S.2
PC-lint runs fine under Windows Vista 32-bit and 64-bit versions.

P.S.3
The last time I checked, there was no 64-bit version of WINE.

Sep 2 '07 #8

"jacob navia" <ja***@jacob.remcomp.frwrote in message
news:46***********************@news.orange.fr...
Nimmi Srivastav wrote:
I am the author of lcc-win32. This is a C compiler that implements
the latest standard C99 under windows. There is a 64 bit version
in the works, and there are 64 and 32 bits versions under linux
and AIX.

Price: Free download. Size: around 5MB. All this is written
in C. Generates very small programs.

If you don't mind me asking, how do you make money on it if you give the
compiler away for free? It doesn't sound like a hobby project.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Sep 2 '07 #9
jacob navia <ja***@jacob.remcomp.frwrites:
[...]
I am the author of lcc-win32. This is a C compiler that implements
the latest standard C99 under windows. There is a 64 bit version
in the works, and there are 64 and 32 bits versions under linux
and AIX.

Language: C99 plus compatible extensions, operator overloading and
generic functions. Other minor extensions like default
arguments are accepted.
[...]

Have you finished implementing C99?

About a year ago, in comp.compilers.lcc, you wrote:
| Designated initializers and structure initializers with the
| dot notation are missing.
|
| I am giving priority to the library, that is kind of
| "mostly" finished. I have probably some problems with
| complex numbers, there hasn't been a good testing of that
| part.
|
| Besides the preprocessor is still missing the variable
| arguments feature.

If these features are still missing, please don't claim that it
implements C99.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 2 '07 #10
On Sun, 2 Sep 2007 10:20:25 +0100, in comp.lang.c , "Malcolm McLean"
<re*******@btinternet.comwrote:
>
"jacob navia" <ja***@jacob.remcomp.frwrote in message
>Price: Free download.
If you don't mind me asking, how do you make money on it if you give the
compiler away for free? It doesn't sound like a hobby project.
Free for *non-commercial* use.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Sep 2 '07 #11
On Sat, 01 Sep 2007 17:54:41 -0700, Nimmi Srivastav wrote:
Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?

Also, is there a C++ compiler akin to lcc-win32?
If you don't need C99 support and can wait for 90MB to download,
use MSVC. Its long double is eight bytes, but at least the fractal
picture I generate computing with them isn't yellowed by a bug
which prevents a three byte struct from being returned correctly.
Also it doesn't have the upper limits of some unsigned types
suffixed with LL without any U. And I didn't get any assertion
failure from its compiler yet.
--
Army1987 (Replace "NOSPAM" with "email")
No-one ever won a game by resigning. -- S. Tartakower

Sep 2 '07 #12
Army1987 wrote:
On Sat, 01 Sep 2007 17:54:41 -0700, Nimmi Srivastav wrote:
>Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?

Also, is there a C++ compiler akin to lcc-win32?

If you don't need C99 support and can wait for 90MB to download,
use MSVC. Its long double is eight bytes, but at least the fractal
picture I generate computing with them isn't yellowed by a bug
which prevents a three byte struct from being returned correctly.
??? This was fixed at least a year ago. Can you send a test
example?
Also it doesn't have the upper limits of some unsigned types
suffixed with LL without any U.
Either it is a fixed bug since ages or you are talking nonsense.

In limits.h I have
#define ULLONG_MAX 18446744073709551615ULL
And I didn't get any assertion
failure from its compiler yet.
Can you provide an example?

Obviously a typo invalidates all other features of this compiler.

Using MSVC of course prevents you from all bugs since it is
a well known thing that Microsoft has never any bugs.

Sep 2 '07 #13
Malcolm McLean wrote:
>
"jacob navia" <ja***@jacob.remcomp.frwrote in message
news:46***********************@news.orange.fr...
>Nimmi Srivastav wrote:
I am the author of lcc-win32. This is a C compiler that implements
the latest standard C99 under windows. There is a 64 bit version
in the works, and there are 64 and 32 bits versions under linux
and AIX.

Price: Free download. Size: around 5MB. All this is written
in C. Generates very small programs.

If you don't mind me asking, how do you make money on it if you give the
compiler away for free? It doesn't sound like a hobby project.
The project is financed by the paying customers.
Sep 2 '07 #14
Richard Heathfield <rj*@see.sig.invalidwrites:
>
I don't know of any C++ compilers ostensibly written by self-serving
buffoons, but of course it's entirely possible that this is merely
ignorance on my part.
And you should now. On both counts.
Sep 2 '07 #15
On 2 Sep, 09:39, jaysome <jays...@hotmail.comwrote:
>
In my experience, the more compilers you can compile your code with
the better. C compilers are free to issue diagnostics for anything and
everything. That's not to say that compilers abuse this and emit
diagnostic messages on a whim, even when nothing is wrong with your
code. On the contrary, compilers emit diagnostic warnings for good
reason. And some compilers do it better than others.
This is excellent advice; even at a hobbyist level you should
always have at least two compilers to check your code against;
it's amazing the range of subtle and not-so-subtle snafus you
can make that one compiler will let through but that another
will catch, and vice-versa, at least in my experience.

Sep 2 '07 #16

jacob navia <ja***@jacob.remcomp.frwrote in message...
>
Using MSVC of course prevents you from all bugs since it is
a well known thing that Microsoft has never any bugs.
BSOD is a *feature*.
If you don't like it, upgrade (hey, it's only another $400!).

--
Bob <GR
POVrookie
Sep 2 '07 #17
Richard Heathfield wrote:
Nimmi Srivastav said:
.... snip ...
>
>Also, is there a C++ compiler akin to lcc-win32?

I don't know of any C++ compilers ostensibly written by self-serving
buffoons, but of course it's entirely possible that this is merely
ignorance on my part.
I think this is an unnecessary dig.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com

Sep 2 '07 #18
On Sat, 01 Sep 2007 17:54:41 -0700, Nimmi Srivastav
<ni*************@yahoo.comwrote:
>
For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?
This is not an /either-or/ situation.

Installation of lcc-win32 takes about 1 minute. (It's a rather slim
piece of software, and that's rather convenient.) --- On the other
hand no C++.

So why not install both compilers/IDEs?
K. H.

--

E-mail: info<at>simple-line<Punkt>de
Sep 2 '07 #19
On Sun, 02 Sep 2007 06:32:25 +0000, Richard Heathfield
<rj*@see.sig.invalidwrote:
>>
Also, is there a C++ compiler akin to lcc-win32?
I don't know of any C++ compilers ostensibly written
by self-serving buffoons [...]
This was an unprovoked attack. :-(
K. H.

--

E-mail: info<at>simple-line<Punkt>de
Sep 2 '07 #20
On Sun, 02 Sep 2007 13:14:46 +0200, jacob navia
<ja***@jacob.remcomp.frwrote:
>
Using MSVC of course prevents you from all bugs since it is
a well known thing that Microsoft has never any bugs.
Sure. If there is bug free software on earth it's from Microsoft, or
so. (Hey, it's not a bug it's a f...)
K. H.

--

E-mail: info<at>simple-line<Punkt>de
Sep 2 '07 #21
On Sun, 02 Sep 2007 09:19:30 -0700, tragomaskhalos
<da*************@logicacmg.comwrote:
>>
In my experience, the more compilers you can compile your code with
the better. C compilers are free to issue diagnostics for anything and
everything. That's not to say that compilers abuse this and emit
diagnostic messages on a whim, even when nothing is wrong with your
code. On the contrary, compilers emit diagnostic warnings for good
reason. And some compilers do it better than others.
This is excellent advice; even at a hobbyist level you should
always have at least two compilers to check your code against;
it's amazing the range of subtle and not-so-subtle snafus you
can make that one compiler will let through but that another
will catch, and vice-versa, at least in my experience.
Agree.

Actually, I'm "using" DJGPP (gcc), mingw gcc, lcc-win32 and Pelles-C
here. (And I'm considering to install Visual C++ Express 2005 Edition
as well as Borland's Turbo C++ Explorer)
K. H.

--

E-mail: info<at>simple-line<Punkt>de
Sep 3 '07 #22
On Sep 2, 1:32 am, Richard Heathfield <r...@see.sig.invalidwrote:
I don't know of any C++ compilers ostensibly written by self-serving
buffoons, but of course it's entirely possible that this is merely
ignorance on my part.
I follow these threads from time to time. I may be wrong, but I
always feel that we like to pick on poor Jacob Navia. He is one of
our favorite punching bags. Is there any background to this that we
need to be aware of, or is this mere animus?

Just my $0.02 worth,
Gus

Sep 3 '07 #23
Karl Heinze said:
On Sun, 02 Sep 2007 06:32:25 +0000, Richard Heathfield
<rj*@see.sig.invalidwrote:
>>>
Also, is there a C++ compiler akin to lcc-win32?
I don't know of any C++ compilers ostensibly written
by self-serving buffoons [...]
This was an unprovoked attack. :-(
I disagree.

When I first encountered Mr Navia in Usenet, I accorded him the
tremendous amount of respect one reserves for those who write C
implementations. Over the years, however, he has proved over and over
again, by frequent revelations of his ignorance of the C language and
(more importantly) his apparent inability to recognise and deal with
that ignorance, that my initial impression of him was mistaken.

My statement might, I suppose, reasonably be seen as an attack. It was,
however, far from unprovoked.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 3 '07 #24
Generic Usenet Account said:
On Sep 2, 1:32 am, Richard Heathfield <r...@see.sig.invalidwrote:
>I don't know of any C++ compilers ostensibly written by self-serving
buffoons, but of course it's entirely possible that this is merely
ignorance on my part.

I follow these threads from time to time. I may be wrong, but I
always feel that we like to pick on poor Jacob Navia. He is one of
our favorite punching bags. Is there any background to this that we
need to be aware of, or is this mere animus?
It is entirely possible that Jacob Navia has, in the last few weeks,
become a model of correctness; that he has stopped pushing his compiler
in clc; that he has stopped making highly personal and insulting
attacks on those who raise reasonable points with which he doesn't
agree or which (more often) he seems to be incapable of understanding;
that he has started accepting corrections instead of arguing the toss
over them; that he has recognised that the proper place for proposing
language changes is comp.std.c rather than comp.lang.c; and that he has
given up trying to pretend that his language extensions are standard C
features.

Yes, it's entirely possible. But it's unlikely. I wouldn't know, since I
plonked him some weeks ago. Based on such quotes as I have seen in
replies to him by others, however, I can't say that such a renaissance
seems terribly likely.

If ever it does happen, I'll be delighted for Mr Navia. But, alas, I'm
not holding my breath.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 3 '07 #25
On Mon, 03 Sep 2007 02:35:57 +0000, Richard Heathfield
<rj*@see.sig.invalidwrote:
>
and that he has given up trying to pretend that his language extensions
are standard C features.
AFAIK, *he* _doesn't_ do that. On the other hand, _extending_ C with
the features Jacob added to the language imho isn't that good an idea,
since it breaks portability (if you can't resist using this features).
And right, *I* know what I'm talking about... ;-)

Maybe it would be a good idea to call this extended language, say, C+.
(Note that some of those features are also to be found in C++.)

Then his compiler (lcc-win32) would be able to compile C and C+.
K. H.

--

E-mail: info<at>simple-line<Punkt>de
Sep 3 '07 #26
On Mon, 03 Sep 2007 02:25:34 +0000, Richard Heathfield
<rj*@see.sig.invalidwrote:
>>>>
Also, is there a C++ compiler akin to lcc-win32?

I don't know of any C++ compilers ostensibly written
by self-serving buffoons [...]
This was an unprovoked attack. :-(

I disagree.
Well, if you think so.
>
When I first encountered Mr Navia in Usenet, I accorded him the
tremendous amount of respect one reserves for those who write C
implementations. Over the years, however, he has proved over and over
again, by frequent revelations of his ignorance of the C language and
(more importantly) his apparent inability to recognise and deal with
that ignorance, that my initial impression of him was mistaken.
I see. Now THAT sounds a lot more reasonable than "self-serving
buffoon".

Personally, I don't think that _extending_ C with the features Jacob
added to the language is that good an idea, since it breaks
portability (if you can't resist using this features). Actually, *I*
already got trapped myself... ;-)

Maybe it would be a good idea to call this extended language, say, C+.
(Note that some of those features are also to be found in C++.)

Then his compiler (lcc-win32) would be able to compile C and C+.
(If Jacob only could get that point.)
K. H.

--

E-mail: info<at>simple-line<Punkt>de
Sep 3 '07 #27
Karl Heinze said:

<snip>
Maybe it would be a good idea to call this extended language, say, C+.
There is already a language with the name C+, which is unrelated either
to C or to C++.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 3 '07 #28
On Mon, 03 Sep 2007 07:40:38 +0000, Richard Heathfield
<rj*@see.sig.invalidwrote:
>>
Maybe it would be a good idea to call this extended language, say, C+.
There is already a language with the name C+, which is unrelated either
to C or to C++.
What a pity. In this case I would suggest "Navia-C". :-)
K. H.
P.S.
Then his compiler (lcc-win32) would be able to compile C and Navia-C.
:-)

--

E-mail: info<at>simple-line<Punkt>de
Sep 3 '07 #29
Richard Heathfield <rj*@see.sig.invalidwrites:
It is entirely possible that Jacob Navia has, in the last few weeks,
....
given up trying to pretend that his language extensions are standard C
features.
LOL! Sounds a lot like David Stes in c.l.objective-c.

I guess every group has one... :-)

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Sep 3 '07 #30
Richard Heathfield <rj*@see.sig.invalidwrites:
>
If ever it does happen, I'll be delighted for Mr Navia. But, alas, I'm
not holding my breath.
Please do. For a long, long time.

"alas".

You are the definition of Narcissus.
Sep 3 '07 #31
[followup set to comp.lang.c]
On Sun, 02 Sep 2007 13:14:46 +0200, jacob navia wrote:
Army1987 wrote:
[snip]
>If you don't need C99 support and can wait for 90MB to download,
use MSVC. Its long double is eight bytes, but at least the fractal
picture I generate computing with them isn't yellowed by a bug
which prevents a three byte struct from being returned correctly.

??? This was fixed at least a year ago. Can you send a test
example?
http://groups.google.it/group/comp.l...2f1a7d476c7c65
>Also it doesn't have the upper limits of some unsigned types
suffixed with LL without any U.

Either it is a fixed bug since ages or you are talking nonsense.

In limits.h I have
#define ULLONG_MAX 18446744073709551615ULL
And in stdint.h you have (except for the comments):
#ifndef __stdint_h__
#define __stdint_h__

[snip]

#define INTMAX_C(a) (a##LL)
#define UINTMAX_C(a) (a##LL)
/* What? */

typedef char int_fast8_t;
typedef unsigned char uint_fast8_t;
typedef short int_fast16_t;
/* well, is int_fast16_t smaller than int? The standard suggests
* that int has the "natural" size, so is something unnatural
* faster? Also, on glibc with this same processor int_fast16_t
* is int, does the relative speed of types depend on the OS, on
* the compiler, or what? */
typedef unsigned short uint_fast16_t;
typedef int int_fast32_t;
typedef unsigned int uint_fast32_t;
typedef long long int_fast64_t;
typedef unsigned long long uint_fast64_t;

[snip]

#define INT8_MIN -128
#define INT16_MIN -32768
#define INT32_MIN -2147483648
/* 2147483648 doesn't fit in a int32_t, so its type can't be
* int32_t, and neither the type of its negation can. */
#define INT64_MIN -9223372036854775808LL
/* 9223372036854775808 doesn't fit in any signed type... */

[snip]

#define RSIZE_MAX INT32_MAX
/* Well, where on Earth does the C standard grant you the right to
* invade the user namespace like that? */
#endif

Well, I remembered the other way round... Except for the case of
the UINTMAX_C macro...
>
And I didn't get any assertion
failure from its compiler yet.

Can you provide an example?

Obviously a typo invalidates all other features of this compiler.

Using MSVC of course prevents you from all bugs since it is
a well known thing that Microsoft has never any bugs.
If the OP wants to be "prevented from all bugs" he'd not be using
Windows in the first place (or even not a computer in the first
place...) :-)
--
Army1987 (Replace "NOSPAM" with "email")
No-one ever won a game by resigning. -- S. Tartakower

Sep 3 '07 #32
Army1987 wrote:
[followup set to comp.lang.c]
On Sun, 02 Sep 2007 13:14:46 +0200, jacob navia wrote:
>Army1987 wrote:
[snip]
>>If you don't need C99 support and can wait for 90MB to download,
use MSVC. Its long double is eight bytes, but at least the fractal
picture I generate computing with them isn't yellowed by a bug
which prevents a three byte struct from being returned correctly.
??? This was fixed at least a year ago. Can you send a test
example?
http://groups.google.it/group/comp.l...2f1a7d476c7c65
This is a discussion where people talk about functions returning
structures. No bugs report in there.
>>Also it doesn't have the upper limits of some unsigned types
suffixed with LL without any U.
Either it is a fixed bug since ages or you are talking nonsense.

In limits.h I have
#define ULLONG_MAX 18446744073709551615ULL

And in stdint.h you have (except for the comments):
#ifndef __stdint_h__

#define __stdint_h__

[snip]

#define INTMAX_C(a) (a##LL)

#define UINTMAX_C(a) (a##LL)
fixed.
>
typedef short int_fast16_t;

/* well, is int_fast16_t smaller than int? The standard suggests

* that int has the "natural" size, so is something unnatural

* faster?
Loading a short should be faster than loading an integer
since it makes less i/o.
Also, on glibc with this same processor int_fast16_t

* is int, does the relative speed of types depend on the OS, on
* the compiler, or what? */
See above
#define INT32_MIN -2147483648

/* 2147483648 doesn't fit in a int32_t, so its type can't be

* int32_t, and neither the type of its negation can. */
Well apparently it can. Just do a printf of INT32_MIN with
lcc-win32.
#include <stdint.h>
#include <stdio.h>
int main(void)
{
printf("INT32_MIN=%d\n",INT32_MIN);
}

prints the correct value.
#define INT64_MIN -9223372036854775808LL

/* 9223372036854775808 doesn't fit in any signed type... */

#include <stdint.h>
#include <stdio.h>
int main(void)
{
printf("INT32_MIN=%lld\n",INT32_MIN);
}

prints the correct value...
>
[snip]

#define RSIZE_MAX INT32_MAX

/* Well, where on Earth does the C standard grant you the right to

* invade the user namespace like that? */
RSIZE_MAX is defined in the Technical Report proposed to the standards
comitee by Microsoft.
Lcc-win32 uses RSIZE_MAX
>
#endif

[snip rants]
Sep 3 '07 #33
In article <46******************************@comcast.com>, Victor
Bazarov <v.********@comAcast.netwrites
>Nimmi Srivastav wrote:
>Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?

I've used MS compilers (with various success) from around 1990, and
eventually (unfortunately, only recently) they got quite decent. I
cannot vouch for their C[99] support, but their C++ compliance is
very good.
ISO Compliance is not relevant. The OP is looking for an easy
(inexpensive) way of creating applications for MS Windows. A compiler
that is MS compliant is what is required.

Which is why people use GCC on Linux. Because both use the same flavour
of C.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Sep 3 '07 #34
In article <11**********************@d55g2000hsg.googlegroups .com>,
Nimmi Srivastav <ni*************@yahoo.comwrites
>Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?
No contest. Visual C++ Express 2005.
Why?
Not because I like Microsoft
Not because it is the best compiler.

Simply because it will come with a smooth integration into windows, all
the libraries and example projects and lots of help.

In short it is VERY easy for a novice to set up and use with minimum
fuss.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Sep 3 '07 #35
Army1987 <ar******@NOSPAM.itwrites:
[...]
And in stdint.h you have (except for the comments):
#ifndef __stdint_h__
#define __stdint_h__
[SNIP]
#define INT8_MIN -128
#define INT16_MIN -32768
#define INT32_MIN -2147483648
[SNIP]

You didn't enclose these in parentheses? C99 7.1.2 says:

Any definition of an object-like macro described in this clause
shall expand to code that is fully protected by parentheses where
necessary, so that it groups in an arbitrary expression as if it
were a single identifier.

I haven't been able to construct an expression that would be evaluated
differently with or without parentheses in your macro definitions, but
unless you've proven that there isn't one, I'd recommend changing the
definitions. (I always fully parenthesize an object-like macro
definition unless it's already a primary expression.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 3 '07 #36
jacob navia <ja***@jacob.remcomp.frwrites:
Army1987 wrote:
[...]
>typedef short int_fast16_t;
/* well, is int_fast16_t smaller than int? The standard suggests
* that int has the "natural" size, so is something unnatural
* faster?

Loading a short should be faster than loading an integer
since it makes less i/o.
What i/o? Or are you using the term in some odd sense?

You say it *should* be faster; have you measured it?

[...]
>#define INT32_MIN -2147483648
/* 2147483648 doesn't fit in a int32_t, so its type can't be
* int32_t, and neither the type of its negation can. */

Well apparently it can. Just do a printf of INT32_MIN with
lcc-win32.
#include <stdint.h>
#include <stdio.h>
int main(void)
{
printf("INT32_MIN=%d\n",INT32_MIN);
}

prints the correct value.
That doesn't necessarily prove anything.

Try this:

#include <stdint.h>
#include <stdio.h>
int main(void)
{
printf("sizeof INT32_MIN = %d\n", (int)sizeof INT32_MIN);
return 0;
}

[...]
>#define RSIZE_MAX INT32_MAX
/* Well, where on Earth does the C standard grant you the right to
* invade the user namespace like that? */

RSIZE_MAX is defined in the Technical Report proposed to the standards
comitee by Microsoft.
Lcc-win32 uses RSIZE_MAX
Do you provide a way to suppress this declaration?

RSIZE_MAX is not part of standard C. I should be able to use it as an
identifier in my own conforming C program.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 3 '07 #37
Chris Hills <ch***@phaedsys.orgwrites:
[...]
Gcc is not ISO C99 compliant either. (And I think less so than the
MS compilers these days.)
Really? My impression, based entirely on what I've read here, is that
MS has expressed no interest in supporting C99. Do you have better
information?

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 3 '07 #38
Keith Thompson wrote:
jacob navia <ja***@jacob.remcomp.frwrites:
>Army1987 wrote:
[...]
>>typedef short int_fast16_t;
/* well, is int_fast16_t smaller than int? The standard suggests
* that int has the "natural" size, so is something unnatural
* faster?
Loading a short should be faster than loading an integer
since it makes less i/o.

What i/o? Or are you using the term in some odd sense?

You say it *should* be faster; have you measured it?

[...]
>>#define INT32_MIN -2147483648
/* 2147483648 doesn't fit in a int32_t, so its type can't be
* int32_t, and neither the type of its negation can. */
Well apparently it can. Just do a printf of INT32_MIN with
lcc-win32.
#include <stdint.h>
#include <stdio.h>
int main(void)
{
printf("INT32_MIN=%d\n",INT32_MIN);
}

prints the correct value.

That doesn't necessarily prove anything.

Try this:

#include <stdint.h>
#include <stdio.h>
int main(void)
{
printf("sizeof INT32_MIN = %d\n", (int)sizeof INT32_MIN);
return 0;
}
That prints 4.

sizeof(int) == 4 in lcc-win32.

Look. What happens is this:
When the compiler sees that constant, it is converted to long long,
then it is truncated.

This is perfectly legal, and my headers do not have
to be portable to other compilers.

OK?
>
[...]
>>#define RSIZE_MAX INT32_MAX
/* Well, where on Earth does the C standard grant you the right to
* invade the user namespace like that? */
RSIZE_MAX is defined in the Technical Report proposed to the standards
comitee by Microsoft.
Lcc-win32 uses RSIZE_MAX

Do you provide a way to suppress this declaration?

RSIZE_MAX is not part of standard C. I should be able to use it as an
identifier in my own conforming C program.
OK, will had a flag for -ansic.
Sep 3 '07 #39
Keith Thompson wrote:
Army1987 <ar******@NOSPAM.itwrites:
[...]
>And in stdint.h you have (except for the comments):
#ifndef __stdint_h__
#define __stdint_h__
[SNIP]
>#define INT8_MIN -128
#define INT16_MIN -32768
#define INT32_MIN -2147483648
[SNIP]

You didn't enclose these in parentheses? C99 7.1.2 says:

Any definition of an object-like macro described in this clause
shall expand to code that is fully protected by parentheses where
necessary, so that it groups in an arbitrary expression as if it
were a single identifier.
Where necessary.
I haven't been able to construct an expression that would be evaluated
differently with or without parentheses in your macro definitions,

You see?

It is not necessary...

but
unless you've proven that there isn't one, I'd recommend changing the
definitions. (I always fully parenthesize an object-like macro
definition unless it's already a primary expression.)
Proof.

Suppose there is a construct where -1 needs a parentheses.

In that case (-1) "..." != -1 "..."

This means that the expression "..." must have a binary operator
that binds more than unary minus to the constant 1.

Unary minus has precedence 15.

But ALL operators at level 15 are UNARY operators. There are
NO binary operators at level 15.

Remains level 16, with . (point) function call ,
increment decrement, and indexing.

All those operations can't use a manifest constant like 1
or 447766.

Q.E.D

Reference: Harbison and Steele. "C, a reference manual"
See the table of precedences.
Sep 3 '07 #40
Keith Thompson wrote, On 03/09/07 20:24:
Army1987 <ar******@NOSPAM.itwrites:
[...]
>And in stdint.h you have (except for the comments):
#ifndef __stdint_h__
#define __stdint_h__
[SNIP]
>#define INT8_MIN -128
#define INT16_MIN -32768
#define INT32_MIN -2147483648
[SNIP]

You didn't enclose these in parentheses? C99 7.1.2 says:

Any definition of an object-like macro described in this clause
shall expand to code that is fully protected by parentheses where
necessary, so that it groups in an arbitrary expression as if it
were a single identifier.

I haven't been able to construct an expression that would be evaluated
differently with or without parentheses in your macro definitions, but
unless you've proven that there isn't one, I'd recommend changing the
definitions. (I always fully parenthesize an object-like macro
definition unless it's already a primary expression.)
I can think of an instance where it makes a difference.

int x = 5 INT_MAN;

I would expect the above to be an error, but without the parenthesis it
is valid. What the C standard makes of it is another matter.
--
Flash Gordon
Sep 3 '07 #41
On Mon, 03 Sep 2007 02:35:57 +0000, in comp.lang.c , Richard
Heathfield <rj*@see.sig.invalidwrote:
>It is entirely possible that Jacob Navia has, in the last few weeks,
become a model of correctness;
....
>Yes, it's entirely possible. But it's unlikely. I wouldn't know, since I
plonked him some weeks ago. Based on such quotes as I have seen in
replies to him by others, however, I can't say that such a renaissance
seems terribly likely.
Good guess.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Sep 3 '07 #42

"Karl Heinze" <nomail@invalidwrote in message
news:f7********************************@4ax.com...
Personally, I don't think that _extending_ C with the features Jacob
added to the language is that good an idea, since it breaks
portability (if you can't resist using this features). Actually, *I*
already got trapped myself... ;-)
Then lcc-win would compile the same code as Visual C++, probably no more
efficiently, but wouldn't have Microsoft's base of customers or reputation.
So that would be a very tough sell.
However a compiler that is compatible with MS, but does things that MS won't
handle, that's a much more viable business proposition.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
Sep 3 '07 #43
jacob navia <ja***@jacob.remcomp.frwrites:
Keith Thompson wrote:
>jacob navia <ja***@jacob.remcomp.frwrites:
>>Army1987 wrote:
[...]
>>>typedef short int_fast16_t;
/* well, is int_fast16_t smaller than int? The standard suggests
* that int has the "natural" size, so is something unnatural
* faster?
Loading a short should be faster than loading an integer
since it makes less i/o.
What i/o? Or are you using the term in some odd sense?
You say it *should* be faster; have you measured it?
[...]
>>>#define INT32_MIN -2147483648
/* 2147483648 doesn't fit in a int32_t, so its type can't be
* int32_t, and neither the type of its negation can. */

Well apparently it can. Just do a printf of INT32_MIN with
lcc-win32.
#include <stdint.h>
#include <stdio.h>
int main(void)
{
printf("INT32_MIN=%d\n",INT32_MIN);
}

prints the correct value.
That doesn't necessarily prove anything.
Try this:
#include <stdint.h>
#include <stdio.h>
int main(void)
{
printf("sizeof INT32_MIN = %d\n", (int)sizeof INT32_MIN);
return 0;
}

That prints 4.

sizeof(int) == 4 in lcc-win32.

Look. What happens is this:
When the compiler sees that constant, it is converted to long long,
then it is truncated.
Why would it truncated? I used it as an argument of a sizeof
operator; you're not *allowed* to truncate it in that context.

Assuming that int and long are both 32 bits, and long long is 64 bits
(all 2's-complement with no padding bits), then the integer constant
'2147483648' is of type long long (see C99 6.4.4.1). Then the
expression '-2147483648' is also of type long long, with a negative
value.
This is perfectly legal, and my headers do not have
to be portable to other compilers.

OK?
Certainly you can use any compiler-specific tricks you like in your
own headers; they don't have be portable, as long as they implement
the required semantics.

Try this program:
========================================
#define MY_CONST -2147483648

#include <stdio.h>
#include <limits.h>
#include <stdint.h>

int main(void)
{
printf("INT_MIN = %d\n", INT_MIN);
printf("INT_MAX = %d\n", INT_MAX);
printf("sizeof(int) = %d\n", (int)sizeof(int));
putchar('\n');

printf("LONG_MIN = %ld\n", LONG_MIN);
printf("LONG_MAX = %ld\n", LONG_MAX);
printf("sizeof(long) = %d\n", (int)sizeof(long));
putchar('\n');

printf("LLONG_MIN = %lld\n", LLONG_MIN);
printf("LLONG_MAX = %lld\n", LLONG_MAX);
printf("sizeof(long long) = %d\n", (int)sizeof(long long));
putchar('\n');

printf("sizeof MY_CONST = %d\n", (int)sizeof MY_CONST);
printf("sizeof INT32_MAX = %d\n", (int)sizeof INT32_MAX);

return 0;
}
========================================

Using "gcc -std=c99", I get:
========================================
INT_MIN = -2147483648
INT_MAX = 2147483647
sizeof(int) = 4

LONG_MIN = -2147483648
LONG_MAX = 2147483647
sizeof(long) = 4

LLONG_MIN = -9223372036854775808
LLONG_MAX = 9223372036854775807
sizeof(long long) = 8

sizeof MY_CONST = 8
sizeof INT32_MAX = 4
========================================

What do you get?
>[...]
>>>#define RSIZE_MAX INT32_MAX
/* Well, where on Earth does the C standard grant you the right to
* invade the user namespace like that? */
RSIZE_MAX is defined in the Technical Report proposed to the standards
comitee by Microsoft.
Lcc-win32 uses RSIZE_MAX
Do you provide a way to suppress this declaration?
RSIZE_MAX is not part of standard C. I should be able to use it as
an
identifier in my own conforming C program.
OK, will had a flag for -ansic.
You mean "add", right? Great.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 3 '07 #44
On Mon, 03 Sep 2007 15:44:56 -0700, Keith Thompson <ks***@mib.org>
wrote:
>
Try this program:

#define MY_CONST -2147483648

#include <stdio.h>
#include <limits.h>
#include <stdint.h>

int main(void)
{
printf("INT_MIN = %d\n", INT_MIN);
printf("INT_MAX = %d\n", INT_MAX);
printf("sizeof(int) = %d\n", (int)sizeof(int));
putchar('\n');

printf("LONG_MIN = %ld\n", LONG_MIN);
printf("LONG_MAX = %ld\n", LONG_MAX);
printf("sizeof(long) = %d\n", (int)sizeof(long));
putchar('\n');

printf("LLONG_MIN = %lld\n", LLONG_MIN);
printf("LLONG_MAX = %lld\n", LLONG_MAX);
printf("sizeof(long long) = %d\n", (int)sizeof(long long));
putchar('\n');

printf("sizeof MY_CONST = %d\n", (int)sizeof MY_CONST);
printf("sizeof INT32_MAX = %d\n", (int)sizeof INT32_MAX);

return 0;
}

sing "gcc -std=c99", I get:

INT_MIN = -2147483648
INT_MAX = 2147483647
sizeof(int) = 4

LONG_MIN = -2147483648
LONG_MAX = 2147483647
sizeof(long) = 4

LLONG_MIN = -9223372036854775808
LLONG_MAX = 9223372036854775807
sizeof(long long) = 8

sizeof MY_CONST = 8
sizeof INT32_MAX = 4
What do you get?
win-lcc32 (recent version)

INT_MIN = -2147483648
INT_MAX = 2147483647
sizeof(int) = 4

LONG_MIN = -2147483648
LONG_MAX = 2147483647
sizeof(long) = 4

LLONG_MIN = -9223372036854775808
LLONG_MAX = 9223372036854775807
sizeof(long long) = 8

sizeof MY_CONST = 4 <=== ?!
sizeof INT32_MAX = 4
H. K.

--

E-mail: info<at>simple-line<Punkt>de
Sep 4 '07 #45
Karl Heinze <nomail@invalidwrites:
On Mon, 03 Sep 2007 15:44:56 -0700, Keith Thompson <ks***@mib.org>
wrote:
>Try this program:

#define MY_CONST -2147483648

#include <stdio.h>
#include <limits.h>
#include <stdint.h>

int main(void)
{
printf("INT_MIN = %d\n", INT_MIN);
printf("INT_MAX = %d\n", INT_MAX);
printf("sizeof(int) = %d\n", (int)sizeof(int));
putchar('\n');

printf("LONG_MIN = %ld\n", LONG_MIN);
printf("LONG_MAX = %ld\n", LONG_MAX);
printf("sizeof(long) = %d\n", (int)sizeof(long));
putchar('\n');

printf("LLONG_MIN = %lld\n", LLONG_MIN);
printf("LLONG_MAX = %lld\n", LLONG_MAX);
printf("sizeof(long long) = %d\n", (int)sizeof(long long));
putchar('\n');

printf("sizeof MY_CONST = %d\n", (int)sizeof MY_CONST);
printf("sizeof INT32_MAX = %d\n", (int)sizeof INT32_MAX);

return 0;
}

sing "gcc -std=c99", I get:

INT_MIN = -2147483648
INT_MAX = 2147483647
sizeof(int) = 4

LONG_MIN = -2147483648
LONG_MAX = 2147483647
sizeof(long) = 4

LLONG_MIN = -9223372036854775808
LLONG_MAX = 9223372036854775807
sizeof(long long) = 8

sizeof MY_CONST = 8
sizeof INT32_MAX = 4
What do you get?

win-lcc32 (recent version)
You mean lcc-win32, right?
INT_MIN = -2147483648
INT_MAX = 2147483647
sizeof(int) = 4

LONG_MIN = -2147483648
LONG_MAX = 2147483647
sizeof(long) = 4

LLONG_MIN = -9223372036854775808
LLONG_MAX = 9223372036854775807
sizeof(long long) = 8

sizeof MY_CONST = 4 <=== ?!
sizeof INT32_MAX = 4
Looks like a compiler bug.

Here's a simpler test case:

#include <stdio.h>

int main(void)
{
printf("sizeof 2147483647 = %d\n", (int)sizeof 2147483647);
printf("sizeof -2147483647 = %d\n", (int)sizeof -2147483647);
printf("sizeof 2147483648 = %d\n", (int)sizeof 2147483648);
printf("sizeof -2147483648 = %d\n", (int)sizeof -2147483648);
return 0;
}

I get:

sizeof 2147483647 = 4
sizeof -2147483647 = 4
sizeof 2147483648 = 8
sizeof -2147483648 = 8

Incidentally, the behavior differs in C90 vs C99, since the rules for
determining the type of an integer constant were changed. Did you
invoke lcc-win32 in a mode that causes it to (attempt to) conform to C99?

Here's the output I get in C90 mode:

sizeof 2147483647 = 4
sizeof -2147483647 = 4
sizeof 2147483648 = 4
sizeof -2147483648 = 4

I also get warnings about the '2147483648' constants:

c.c:7: warning: this decimal constant is unsigned only in ISO C90
c.c:8: warning: this decimal constant is unsigned only in ISO C90

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 4 '07 #46
On Mon, 03 Sep 2007 17:24:03 -0700, Keith Thompson <ks***@mib.org>
wrote:
>>>
using "gcc -std=c99", I get:

INT_MIN = -2147483648
INT_MAX = 2147483647
sizeof(int) = 4

LONG_MIN = -2147483648
LONG_MAX = 2147483647
sizeof(long) = 4

LLONG_MIN = -9223372036854775808
LLONG_MAX = 9223372036854775807
sizeof(long long) = 8

sizeof MY_CONST = 8
sizeof INT32_MAX = 4

What do you get?
lcc-win32 (recent version):

INT_MIN = -2147483648
INT_MAX = 2147483647
sizeof(int) = 4

LONG_MIN = -2147483648
LONG_MAX = 2147483647
sizeof(long) = 4

LLONG_MIN = -9223372036854775808
LLONG_MAX = 9223372036854775807
sizeof(long long) = 8

sizeof MY_CONST = 4 <=== ?!
sizeof INT32_MAX = 4
Looks like a compiler bug.
Pelles-C gives

sizeof MY_CONST = 8

(like gcc).
>
Here's a simpler test case:

#include <stdio.h>

int main(void)
{
printf("sizeof 2147483647 = %d\n", (int)sizeof 2147483647);
printf("sizeof -2147483647 = %d\n", (int)sizeof -2147483647);
printf("sizeof 2147483648 = %d\n", (int)sizeof 2147483648);
printf("sizeof -2147483648 = %d\n", (int)sizeof -2147483648);
return 0;
}

I get:

sizeof 2147483647 = 4
sizeof -2147483647 = 4
sizeof 2147483648 = 8
sizeof -2147483648 = 8
lcc-win32:

sizeof 2147483647 = 4
sizeof -2147483647 = 4
sizeof 2147483648 = 4
sizeof -2147483648 = 4

Pelles-C:

sizeof 2147483647 = 4
sizeof -2147483647 = 4
sizeof 2147483648 = 8
sizeof -2147483648 = 8
>
Incidentally, the behavior differs in C90 vs C99, since the rules for
determining the type of an integer constant were changed. Did you
invoke lcc-win32 in a mode that causes it to (attempt to) conform to C99?
I guess that's the "standard option". (Some of the other C99 goodies
can be used in that mode.) // And no warnings.
K. H.
P.S.
I hope our discussion will help Jacob to improve his compiler.

--

E-mail: info<at>simple-line<Punkt>de
Sep 4 '07 #47
Chris Hills <ch***@phaedsys.orgwrote:
In article <46******************************@comcast.com>, Victor
Bazarov <v.********@comAcast.netwrites
Nimmi Srivastav wrote:
Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?
I've used MS compilers (with various success) from around 1990, and
eventually (unfortunately, only recently) they got quite decent. I
cannot vouch for their C[99] support, but their C++ compliance is
very good.

ISO Compliance is not relevant. The OP is looking for an easy
(inexpensive) way of creating applications for MS Windows. A compiler
that is MS compliant is what is required.
Dev-C++, then. Unlike either of the ones mentioned by the OP, it is both
free (in the sense of not having to pay for it) and free (in the sense
of not shackling you into its own preferred way of creating programs),
though not Frea (in the sense of chaining you to a Gnu licence, as gcc
does). It's a pretty small download, as well. And it does both C _and_
C++ (though not, AFAIK, C/C++).

[ And why on earth is this cross-posted to comp.sources.d!? ]

Richard
Sep 4 '07 #48
In article <ln************@nuthaus.mib.org>, Keith Thompson
<ks***@mib.orgwrites
>Chris Hills <ch***@phaedsys.orgwrites:
[...]
>Gcc is not ISO C99 compliant either. (And I think less so than the
MS compilers these days.)

Really? My impression, based entirely on what I've read here, is that
MS has expressed no interest in supporting C99. Do you have better
information?
PJP said (I think here) that MSVC was now C99 compliant as MS had got
religion in the last couple of years and don standards compliant.

Actually MS is very actively doing a lot in the standards world (usually
via ECMA and ruffling a few feathers in ISO)
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Sep 4 '07 #49
On 2007-09-04 08:28, Richard Bos wrote:
Chris Hills <ch***@phaedsys.orgwrote:
>In article <46******************************@comcast.com>, Victor
Bazarov <v.********@comAcast.netwrites
>Nimmi Srivastav wrote:
Apologies if my cross posting has offended anyone....

For a pure hobbyist C/C++ programmer, who wants to develop
applications to run on Windows, what would be a better choice to
install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone
have any opinion to share?

I've used MS compilers (with various success) from around 1990, and
eventually (unfortunately, only recently) they got quite decent. I
cannot vouch for their C[99] support, but their C++ compliance is
very good.

ISO Compliance is not relevant. The OP is looking for an easy
(inexpensive) way of creating applications for MS Windows. A compiler
that is MS compliant is what is required.

Dev-C++, then. Unlike either of the ones mentioned by the OP, it is both
free (in the sense of not having to pay for it) and free (in the sense
of not shackling you into its own preferred way of creating programs),
though not Frea (in the sense of chaining you to a Gnu licence, as gcc
does). It's a pretty small download, as well. And it does both C _and_
C++ (though not, AFAIK, C/C++).
In what way dos gcc chain you to GPL, it does not place any restrictions
on the code you write. And I'd just like to point out that Dev-C++ uses
the Mingw gcc.

Personally I prefer Visual C++ 2005 Express since it is free, (in the
sense of not having to pay for it) and free (in the sense of not
shackling you into its own preferred way of creating programs). And it
has got the best debugger I've ever used (not that I have used that
many, but it beats gdb).

--
Erik Wikström
Sep 4 '07 #50

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by clintonG | last post: by
2 posts views Thread by Progman | last post: by
6 posts views Thread by Simon Brown | last post: by
1 post views Thread by Dr T | last post: by
24 posts views Thread by JJ | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.