* climits: unsafe #defines?
@ 2008-06-08 16:37 Denys Vlasenko
0 siblings, 0 replies; only message in thread
From: Denys Vlasenko @ 2008-06-08 16:37 UTC (permalink / raw)
To: gcc
Accudentally noticed this in my freshly built 4.3.1 tree
in climits C++ header file:
#ifndef LLONG_MIN
#define LLONG_MIN -__LONG_LONG_MAX__ - 1
#endif
#ifndef LLONG_MAX
#define LLONG_MAX __LONG_LONG_MAX__
#endif
#ifndef ULLONG_MAX
#define ULLONG_MAX __LONG_LONG_MAX__ * 2ULL + 1
#endif
Think what will happen in this code: if (n < ULLONG_MAX / 20)...
--
vda
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-08 16:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-08 16:37 climits: unsafe #defines? Denys Vlasenko
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 read-only IMAP folder(s) and NNTP newsgroup(s).