Re: Bug#121269: gcc allows dollars in identifiers by default on i386 but fails
On Mon, 26 Nov 2001, Martin v. Loewis wrote:
> Could you kindly elaborate a little? I assume one problem is that $
> indicates literal values to the assembler, as in
>
> movl $.LC1, (%esp)
>
> That explains why dollars at the beginning of identifiers are not
> acceptable. It doesn't explain why dollars *in* identifiers are
> bad. In fact, the assembler doesn't have any problems if the dollar
> sign is not the first character of the identifier.
This is what I wasn't going to elaborate on :-) I believe that dollars
that aren't the first character are ok, but otherwise, they seem to denote
literal values.
> I think this is the prime reason for allowing dollars, too: to put
> them inside an identifier, to access assembler symbols that may be
> otherwise inaccessible.
True.
> Interestingly enough, register names are not an issue on i386 - they
> are prefixed with a percent sign.
Dunno what I was thinking if I mentioned register names :-P I think the
oddly warm weather is getting to me ;-P
> So I don't think the default should be changed at all. If anything,
> the dollar-starts-identifiers special case may require a warning.
That would be optimal if it managed to rewrite the identifiers to
something that gas can handle (powerpc-linux does this, fyi). I'm
wondering how much code is out there that puts them in the beginning,
though. And, either way, the assembler is going to die, so a warning from
gcc would be moot.
C
Reply to: