This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.
On Sat, Feb 06, 1999 at 02:04:00PM -0500, Zack Weinberg wrote:
> It makes sense now. I can make a case for fixing gcc or for changing
> your definition of quad_t:
> - %qd is defined to print a 64 bit quantity, so if long is 64 bits,
> then we shouldn't warn when %qd is used to print something with base
> type long.
Yes, this should make sense.
> - but long isn't 64 bits everywhere, so portable code must use int64_t
> and/or long long to get 64 bits reliably; therefore %qd and %lld
> should warn when given something with base type long.
Current definition of quad_t is encapsulated in machine/cdefs.h, or
something like this, so this is not a portability issue.
`quad_t' will be 64 bits, but the underlying `true' type may change...
what's interesting for us is to get something sensible according to
whether or not the current base type has the same size as the underlying
type or not. I believe such portability warnings belong in the
-ansi -pedantic class.
> It really boils down to whether you think `long long' is an
> abomination or not.
I'm not familiar enough with C9X to have a definite opinion. All I know
is that both `long long' and C9X somewhat break portable old code, where
casting to long and using %ld to print values was enough to ensure
portability, which is precisely why I'm asking for guidance (I also have
heard that C9X confused some C++ related issues and what's going to come
out is currently thoroughly incompatible with the C++ standard, but this
is another issue).
I would very much like to know what's the exact status of stuff such as
atoq(), or printf("%qd"). Does it correspond to any current standard/draft,
or is it just a common extension that is supposed to work in a given way ?
If there is no actual standard to enforce, I fail to see how OpenBSD could
get it `wrong', and I'm mainly trying to keep current practice from breaking
without disturbing correct code.
--
Marc Espie
|anime, sf, juggling, unicycle, acrobatics, comics...
|AmigaOS, OpenBSD, C++, perl, Icon, PostScript...
| `real programmers don't die, they just get out of beta'