This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: CYG_INSTRUMENT_CLOCK+PowerPC+FPU problem.


>>>>> "Sergei" == Sergei Organov <osv@javad.ru> writes:

Sergei> Jesper Skov <jskov@redhat.com> writes: [...]
>> I just had an idea. Maybe we could change the CYG_UNUSED_PARAM to:
>> 
>> #define CYG_UNUSED_PARAM(_type_, _var_) \ if (0) { if ((_var_) ==
>> (_var_)); }
>> 
>> That would always work without any overhead, wouldn't it?

Sergei> Only if optimization is turned on ;-)

That's true. But if compiling without optimization, you probably don't
care about spurious instructions :)

Sergei> This also requires _type_ to have operator '==' (not the case
Sergei> for structs).

Sergei> The obvious replacement

Sergei> if (0) { (_var_) = (_var_); }

What about

#define CYG_UNUSED_PARAM(_type_, _var_) \
  if (0) { if (((CYG_ADDRESS)&(_var_)) != ((CYG_ADDRESS)&(_var_))); }

Is there anything you cannot take the address of?

Jesper

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]