Mailinglist Archive: opensuse (527 mails)

< Previous Next >
[opensuse] Re: SOLVED Re: [opensuse] glib.h triggers new error: /usr/include/pthread.h:1000:58: error: expected ‘;’, ‘,’ or ‘)’ before ‘__cond’
On Wed, Aug 10, 2016 at 6:55 AM, David C. Rankin
<drankinatty@xxxxxxxxxxxxxxxxxx> wrote:

(side note: it also disclosed glib's abuse of enum in
/usr/include/glib-2.0/gobject/gparam.h with


which is definitely not an 'int' constant [by +1])
What it is? Floating point? String?

INT_MAX = (1 << 31) - 1;

Note that in C90 this is implementation defined. Further standards
explicitly call this undefined behavior. GCC documentation on
implementation defined aspects:

o The results of some bitwise operations on signed integers (C90 6.3,
C99 and C11 6.5).

Bitwise operators act on the representation of the value including
both the sign and value bits, where the sign bit is considered
immediately above the highest-value value bit. Signed ‘>>’ acts on
negative numbers by sign extension.

GCC does not use the latitude given in C99 and C11 only to treat
certain aspects of signed ‘<<’ as undefined, but this is subject to

[I admit to not full understand the last sentence being non-native
English speaker, but I take it as "the behavior is not undefined"]

And if you look at generated assembly, this expression is replaced by
-1 integer constant which is pretty much legal in this context.
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >