public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC generates invalid character when compiling hello world program
@ 2021-08-08  5:44 bootmgr
  2021-08-08  9:49 ` Stefan Ring
  0 siblings, 1 reply; 2+ messages in thread
From: bootmgr @ 2021-08-08  5:44 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

The gcc I compiled generated wrong assembly code on Windows.
This gcc is Canadian compiled from Ubuntu, and I did not apply any patches on https://github.com/msys2/MINGW-packages.
Error Messages:
H:\cxx>gcc hw.c
C:\Users\ADMINI~1\AppData\Local\Temp\ccaNW5Tf.s: Assembler messages:
C:\Users\ADMINI~1\AppData\Local\Temp\ccaNW5Tf.s:39: Warning: missing closing `"'
C:\Users\ADMINI~1\AppData\Local\Temp\ccaNW5Tf.s:39: Error: invalid character (0xa in mnemonic


GCC configured by ../gcc/configure --disable-multilib --disable-nls --disable-rpath --disable-win32-registry --enable-gra
phite --enable-languages=c,c++,lto --enable-mingw-wildcard --enable-threads=posix --disable-libstdcxx-pch --disable-libs
tdcxx-verbose --enable-fully-dynamic-string --enable-large-address-aware --host=x86_64-w64-mingw32 --target=x86_64-w64-m
ingw32 --prefix=/mingw64

[-- Attachment #2: source code and assembly code.tgz --]
[-- Type: application/x-gzip, Size: 672 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GCC generates invalid character when compiling hello world program
  2021-08-08  5:44 GCC generates invalid character when compiling hello world program bootmgr
@ 2021-08-08  9:49 ` Stefan Ring
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Ring @ 2021-08-08  9:49 UTC (permalink / raw)
  To: gcc-help

On Sun, Aug 8, 2021 at 7:45 AM bootmgr--- via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> The gcc I compiled generated wrong assembly code on Windows.
> This gcc is Canadian compiled from Ubuntu, and I did not apply any patches on https://github.com/msys2/MINGW-packages.
> Error Messages:
> H:\cxx>gcc hw.c
> C:\Users\ADMINI~1\AppData\Local\Temp\ccaNW5Tf.s: Assembler messages:
> C:\Users\ADMINI~1\AppData\Local\Temp\ccaNW5Tf.s:39: Warning: missing closing `"'
> C:\Users\ADMINI~1\AppData\Local\Temp\ccaNW5Tf.s:39: Error: invalid character (0xa in mnemonic
>
>
> GCC configured by ../gcc/configure --disable-multilib --disable-nls --disable-rpath --disable-win32-registry --enable-gra
> phite --enable-languages=c,c++,lto --enable-mingw-wildcard --enable-threads=posix --disable-libstdcxx-pch --disable-libs
> tdcxx-verbose --enable-fully-dynamic-string --enable-large-address-aware --host=x86_64-w64-mingw32 --target=x86_64-w64-m
> ingw32 --prefix=/mingw64

The problem is this line (and it’s not line number 39, as in your
error message):

    .ascii "Hello world!\^@"^M (as displayed by Emacs)

The last few characters in hex: 5c 00 22 0d 0a. There is a 00 byte
after the backslash for some reason.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-08  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-08  5:44 GCC generates invalid character when compiling hello world program bootmgr
2021-08-08  9:49 ` Stefan Ring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).