Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22118

AT&T Assembly Syntax in C program (Mingw gcc) [duplicate]

$
0
0

This simple program((AT&T Assembly Syntax) ) works fine on Linux, but compiles on windows with an error。

.section .text.type add,@function.global add add:     pushq  %rbp     movq   %rsp, %rbp     movl   %ecx, 16(%rbp)     movl   16(%rbp), %eax     imull  %eax, %eax     popq   %rbp     ret

The error is in the second line:

.type add,@function

this pseudo-command will report an error under windows with the following error message,use MinGw gcc:

add.S:2: Warning: .type pseudo-op used outside of .def/.endef: ignored.add.S:2: Error: junk at end of line, first unrecognized character is `a'

This is so strange and I want to know why?


Viewing all articles
Browse latest Browse all 22118

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>