bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/190] gas should accept constant suffixes "u", "l", "ul", "ll",


From: benh at kernel dot crashing dot org
Subject: [Bug gas/190] gas should accept constant suffixes "u", "l", "ul", "ll", "ull"
Date: 4 Jun 2004 03:44:53 -0000

------- Additional Comments From benh at kernel dot crashing dot org  
2004-06-04 03:44 -------
In the linux kernel, we have a certain amount of constants defined
in .h files that are to be used by both C and assembly code. The
most common case is the CPU_FTR_* ones which are bitmasks of CPU
features.

They are to be used as part of an unsigned long (and thus go beyond
the normal capacity of an int). This is +/- ok with gcc, but Linus
explained us that this can be tricky depending on how they are used
due to the way they can be implicitly casted, and would prefer us to
use explicit typing for such constants (that is ul in our case).
Linus own "sparse" C parser used for static checking of the kernel
will actually issue warnings as the constants are supposed to be int
(32 bits) while our are obviously long (at least, that is 64 bits).

Right now, we are using ugly macro constructs to add the "ul" to C code
only, but that is really ugly. Linus and I agree that the proper fix
in this case would be for gas to accept the same suffixes as C (even if
it just ignores them ;)

-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=190

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]