fix hotspot build failures with -D_FORTIFY_SOURCE=2 and -Wformat=1
Kelly.Ohair at Sun.COM
Thu Dec 4 10:34:15 PST 2008
The issue seems so simple to me.
If the function return is to be ignored, you make an explicit cast
to void. This practice is so old and common I don't understand why
it's so complicated.
gcc/g++ are not the only compilers on the planet.
Writing portable C or C++ code becomes increasingly more complicated
when you have to rely on special features of the compiler to get them
to shut up about perfectly valid code.
What happened to following the standards?
WG14/N1124 18.104.22.168 void
"... If an expression of any other type is evaluated as a void
expression, its value or designator is discarded.
(A void expression is evaluated for its side effects.)"
Christian Thalinger wrote:
> On Thu, 2008-12-04 at 12:04 +1000, David Holmes - Sun Microsystems
>> Matthias Klose said the following on 12/04/08 06:36:
>>> this is http://gcc.gnu.org/PR25509, not seen as a bug in GCC. I'll discuss a
>>> solution for Ubuntu with my coworkers next week.
>> What a dismal state of affairs. :(
> Ugh, yeah. After reading some of the comments, I'd say it's a bug in
> GCC and glibc. I wonder if that ever gets changed... on either side...
> - Christian
More information about the hotspot-dev