Bill Allombert on Sun, 13 Oct 2002 11:31:34 +0200


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

Re: annoying warnings


On Thu, Oct 10, 2002 at 06:44:46PM -0400, Igor Schein wrote:
> Hi,
> 
> on Linux/ix86 gcc-2.96 and newer gives the following warnings:
> 
> ../src/kernel/ix86/l0asm.c:104:1: warning: pasting "addll" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:114:1: warning: pasting "addllx" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:126:1: warning: pasting "subll" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:136:1: warning: pasting "subllx" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:148:1: warning: pasting "shiftl" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:160:1: warning: pasting "shiftlr" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:172:1: warning: pasting "bfffo" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:181:1: warning: pasting "mulll" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:189:1: warning: pasting "addmul" and ":" does not give a valid preprocessing token
> ../src/kernel/ix86/l0asm.c:200:1: warning: pasting "divll" and ":" does not give a valid preprocessing token
> 
> I don't understand them.  Anyone?

CPP has been fully rewritten in 2.96 and higher.

The problem is that we lie to CPP about the nature of the file:
we present it as a C file but src/kernel/ix86/l0asm.c is really an assembly
file:

level0.s: $src/kernel/ix86/l0asm.c $src/kernel/ix86/l0asm.h
        \$(CPP) $src/kernel/ix86/l0asm.c | sed -e '/^#/d' -e '/^ *#line/d' -e 's
/%  */%/g' > level0.s

The warning are due to some asm construct being valid but not corresponding
to a valid C construct.

There is two work around:
--- Either rename the file l0asm.S but this is not portable since a lot of C
compilers (GCC include) would not process files with an unknow extension
without some special directives.

--- Pass "-x assembler-with-cpp" to cpp, which is not portable.

Anyway this will shut up the warnings but will not alter the output file,
so...

Cheers,
Bill.