Re: Simplicity has a future



Richard Heathfield wrote:
Ian Collins said:


Richard Heathfield wrote:

The others
are only errors in C99, which doesn't count.


Hang on a minute, you're posting code that won't compile as C99 and
asking the audience to convert it to C++? Given your original rules, it
can't be morphed to C99, let alone C++.


The claim I was addressing, which was originally made by Tomas, is that "I
can copy-paste your C code and compile it as C++". Are you claiming that
C90 code is not C code unless it is also C99 code?

No, but I still find it amusing that the example can't be compiled as
(current) standard C. There must be some humour in that somewhere.

I'm sure I could turn my C99 compiler back to C90, but why bother?


Which C99 compiler are you using? If the answer is "gcc", why bother to
claim that you have a C99 compiler? (gcc is /not/ a conforming C99
compiler.)

Never use it. I use Sun Studio, which is approaching C99 conformance.
The Solaris headers have also migrated to C99.

Maybe if you can explain the usefulness to mankind of the code, I might
give it a go....


Like much code posted here, its usefulness to mankind is that it illustrates
a point about the language. In this case, the point is that the claim "I
can copy-paste your C code and compile it as C++" is demonstrably false.

Neither of the compliers I have will compile it, gcc or Studio. Studio
barfs over asm.

--
Ian Collins.
.



Relevant Pages

  • Re: C structure definition
    ... >structure definition. ... and hence probably using GCC. ... system-specific code will not even compile unless they are on). ... Note that versions of gcc that support C99 to various degrees (none ...
    (comp.lang.c)
  • undefined refrence to a function
    ... I have been trying to compile some source code that is supposed to be ... working and getting some compilation errors. ... using gcc -lm helped to resolve the problems with defining the ... is using C99 VS C90 library. ...
    (comp.lang.c)
  • Re: gcc 4.3: when will it become standard compiler?
    ... But I'm not exactly sure what you mean by "compile world with C99". ... In fact default mode of GCC accepts many C99 constructs like // comments and mixed declarations and code, which are not valid C89. ... my point is that in C89 mode *restrict* got expanded ...
    (freebsd-current)
  • Re: undefined refrence to a function
    ... I have been trying to compile some source code that is supposed to be ... the problem by telling GCC to link math libraries if it's not done by ... using gcc -lm helped to resolve the problems with defining the ... is using C99 VS C90 library. ...
    (comp.lang.c)
  • Re: Defining int64
    ... will fail to compile on such an implementation; ... attempting to port it will at least be ade aware of the trouble. ... is mandated by C99 but was absent from C90, ... support for `long long' in things like printfmay not ...
    (comp.lang.c)