tech-kern archive

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

Re: KNF and the C preprocessor



On Tue, Dec 11, 2012 at 04:02:57AM -0500, Mouse wrote:
> >>> So I need to stop the compiler tail merging the two parts of the
> >>> inside 'if'
> >>> There is nothing I can put inside an inline function version of
> >>> cmd() that will stop this happening.
> >> If you have an example of [something you can put in a macro but not
> >> a function] that'll [prevent that] I'd be interested.
> > An assembler comment - from something like:
> > asm volatile("; " STR(__LINE__))
> 
> How is that any more effective in a macro than in an inline function?
> What am I missing here?

In a #define it generates different text stopping the compiler
merging the two 'tails'.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index