GCC generuje błędny asm
Arkadiusz Miśkiewicz
arekm at maven.pl
Wed Mar 28 16:02:23 CEST 2012
On Wednesday 28 of March 2012, Bartosz Świątek wrote:
> W dniu 28 marca 2012 15:47 użytkownik Arkadiusz Miśkiewicz
>
> <arekm w maven.pl> napisał:
> > On Wednesday 28 of March 2012, Bartosz Świątek wrote:
> >> Cześć,
> >>
> >> taki oto najprostszy program:
> >>
> >> int $12 = 0;
> >>
> >> int main() {
> >> return $12;
> >> }
> >>
> >> mam kaprys nazwać sobie zmienną $12, bo niby czemu nie.
> >
> > http://bit.ly/GY1fK2
>
> Nie zauważyleś $ przed 1? Moja nazwa zmiennej nie zaczyna się od
> cyfry. Wszystko jest zatem dozwolone.
Ano nie.
"The rules for the construction of identifiers are simple: you may use the 52
upper and lower case alphabetic characters, the 10 digits and finally the
underscore ‘_’, which is considered to be an alphabetic character for this
purpose. The only restriction is the usual one; identifiers must start with an
alphabetic character."
>
> >> Kompilacja zwraca:
> >>
> >> $ gcc test.c
> >> /home/users/shadzik/tmp/ccFZKf57.s: Assembler messages:
> >> /home/users/shadzik/tmp/ccFZKf57.s:20: Error: junk `(%rip)' after
> >> expression
> >
> >> Ojej, no to sprawdźmy co to za brzydki asm z tego wyszedł (gcc -S
test.c):
> > Nawet gcc robi Cię w wała.
>
> No nie za bardzo. Zrozum problem, pogadamy.
Jednak.
--
Arkadiusz Miśkiewicz PLD/Linux Team
arekm / maven.pl http://ftp.pld-linux.org/
More information about the pld-devel-pl
mailing list