linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about ULLONG_MAX
@ 2007-07-02  8:55 Holger Kiehl
  2007-07-02 12:57 ` Stephen Kratzer
  2007-07-02 18:55 ` Glynn Clements
  0 siblings, 2 replies; 4+ messages in thread
From: Holger Kiehl @ 2007-07-02  8:55 UTC (permalink / raw)
  To: linux-c-programming

Hello

When compiling the following program on a Fedora 6 x86_64 system:

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

    int
    main(void)
    {
       (void)printf("%llu\n", ULLONG_MAX);

       return 0;
    }

Produces the following result:

   cc longlong.c
   longlong.c: In function 'main':
   longlong.c:7: error: 'ULLONG_MAX' undeclared (first use in this function)
   longlong.c:7: error: (Each undeclared identifier is reported only once
   longlong.c:7: error: for each function it appears in.)

If I compile it with cc -std=c99 longlong.c it works.

Why is it necessary to specify -std=c99? If I use for example strtoull()
I do not need to set -std=c99.

Compiling the above on AIX compiles and runs without problems. Also
on an older Solaris 8 system using gcc (3.3.2) it compiles and runs
straight out of the box.

If I want to use ULLONG_MAX how can I do this in a portable way so it
compiles on different systems?

Thanks,
Holger


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-02 20:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-02  8:55 Question about ULLONG_MAX Holger Kiehl
2007-07-02 12:57 ` Stephen Kratzer
2007-07-02 18:55 ` Glynn Clements
2007-07-02 20:39   ` Holger Kiehl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).