On Sun, Jun 7, 2009 at 19:27, Quentin Mathé wrote:

> Le 6 juin 09 à 20:09, Quentin Mathé a écrit :
>
>> Le 3 juin 09 à 22:38, Truls Becken a écrit :
>>
>>> There is also one I did not include in the diff; ETUUID uses an
>>> uninitialized variable on purpose to generate a random seed (as a
>>> fallback in case /dev/random does not work). GCC 4.4 does not like
>>> that.
>
> There is no __attribute___((uninitialized)), so may be you can try to
> see whether a diagnostic pragma works. I mean something like:
> #else
> #pragma GCC diagnostic ignored "-Wuninitialized"
> static void ETSRandomDev()
> {
> However I'm not sure this warning support to be tweaked with a pragma.
> If it isn't the case, we'll have to turn it off globally in Source/
> GNUmakefile at least for platforms other than BSDs and Linux.

The diagnostic pragma worked, but it affects the whole file, doesn't it?

Declaring the variable as volatile also satisfied GCC. This has the
advantage of being fine grained, but it also unnecessarily turns off
all optimizations involving that variable, not that I think this
matters.

Which approach is better?

-Truls

_______________________________________________
Etoile-dev mailing list
Etoile-dev@gna.org
https://mail.gna.org/listinfo/etoile-dev

Reply via email to