bug-gnulib
[Top][All Lists]
Advanced

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

Sun C++ bug with stdbool


From: Eric Blake
Subject: Sun C++ bug with stdbool
Date: Fri, 16 Apr 2010 14:56:41 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4

$ cat foo.cc
char f[(bool)0==0?1:-1];
char g[(int)0.0==0?1:-1];
char h[(bool)0.0==0?1:-1];
$ CC -c foo.cc
"foo.cc", line 3: Error: An integer constant expression is required
within the array subscript operator.
1 Error(s) detected.
$ CC -V
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-19 2009/12/02

Unfortunately, this compiler bug means that Sun CC fails test-stdbool.
Should we just exempt line 53 if we detect the broken compiler, or
should we make the stdbool module more robust by checking for this C++
compiler bug with bool, and if present, use something like #define bool
signed char?

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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