autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uint64_t fails with C++


From: Bob Friesenhahn
Subject: Re: uint64_t fails with C++
Date: Wed, 7 Dec 2011 16:20:33 -0600 (CST)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Wed, 7 Dec 2011, Nick Bowler wrote:

Clearly, depending on an implementation-dependent macro is not
suitable for portable software.

i thought __STDC_LIMIT_MACROS was part of the spec and thus not
"implementation dependent" ?

Sort-of.  It is included non-normatively in the C specification as a
recommendation to C++ implementations.  C++98 didn't include these
macros at all, and thus had nothing to say on the subject.

Nevertheless, the latest revision of the C++ specification includes
these macros, and explicitly states that you do *not* need to define
__STDC_LIMIT_MACROS to get them.

Regardless, it is worth pointing out that even if a standard specifies particular behavior, if all target platforms do not consistently implement that behavior, then the behavior is effectively "implementation dependent".

If we could always safely code according to the latest specification then the task would become much easier. Unfortunately, we need to handle platforms/systems which were fielded well before the specifications were implemented. This means that we need to be prepared to handle systems of some vintage, while striving to write code which is similar to (or uses) the current standards.

Bob
--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]