Re: Code Required Compiler Options

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

 



carnellr <carnellr@xxxxxxxxxxxx> writes:
[snip]
> Is there a way to require that -fno-strict-aliasing be set when
> compiling through the use of pragmas?  I would like an error to be
> thrown at compile time if it is not set.  Something like #pragam
> require -fno-strict-aliasing would be nice.

Perhaps you can just force it off.  Does

  #pragma GCC optimize ("no-strict-aliasing")

do what you want? and/or

  __attribute__ ((optimize("no-strict-aliasing")))

on particular functions?

I haven't tested this, but

  http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Function-Specific-Option-Pragmas.html#Function-Specific-Option-Pragmas
  http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Function-Attributes.html

implies it might work.

HTH,

-tom

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux