01-27-05 07:51 AM
On 2005-01-27, John Smith <john.smith@x-formation.com> wrote:
> I have a fairly complex build with lots of makefiles. One C++ file is
> auto-generated and included into this build into many applications which
> uses it. Basicly I need to compile it with -O0 when all other files are
> compiled with -O2.
>
> In Microsoft C++ compiler it's quite easy to turn off the optimization for
> this particular file with a #pragma:
>
> #ifdef _MSC_VER
> #pragma optimize("", off)
> #endif
>
> void FuncA()
> {
>
> ..
> }
>
> #ifdef _MSC_VER
> #pragma optimize("", on)
> #endif
>
> Is there a similar thing you can do with gcc/g++?
Have you considered manipulating make files and not the source file?
After all make if fairly flexible to implement things like that (check
for example target specific variables).
--
Minds, like parachutes, function best when open
[ Post a follow-up to this message ]
|