Skip to content

Instantly share code, notes, and snippets.

@danmcd
Created February 7, 2022 15:28
Show Gist options
  • Save danmcd/819ef0de2b14bad1af4822572e29163d to your computer and use it in GitHub Desktop.
Save danmcd/819ef0de2b14bad1af4822572e29163d to your computer and use it in GitHub Desktop.
gcc7 vs gcc10
smartos-build-2(~/gcc10-shadow)[0]% cat /tmp/simple.c
#include <stdio.h>
main()
{
printf("Hello, world.\n");
}
smartos-build-2(~/gcc10-shadow)[0]% gcc --version
gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
smartos-build-2(~/gcc10-shadow)[0]% proto.strap/usr/gcc/7/bin/gcc --version
gcc (GCC) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
smartos-build-2(~/gcc10-shadow)[0]% proto.strap/usr/gcc/10/bin/gcc --version
gcc (GCC) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
smartos-build-2(~/gcc10-shadow)[0]% gcc -o /tmp/simple /tmp/simple.c
/tmp/simple.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
main()
^~~~
smartos-build-2(~/gcc10-shadow)[0]% echo "__xpg4/X" | mdb /tmp/simple
mdb: failed to dereference symbol: unknown symbol name
smartos-build-2(~/gcc10-shadow)[0]% proto.strap/usr/gcc/7/bin/gcc -o /tmp/simple /tmp/simple.c
/tmp/simple.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
main()
^~~~
smartos-build-2(~/gcc10-shadow)[0]% echo "__xpg4/X" | mdb /tmp/simple
mdb: failed to dereference symbol: unknown symbol name
smartos-build-2(~/gcc10-shadow)[0]% proto.strap/usr/gcc/10/bin/gcc -o /tmp/simple /tmp/simple.c
/tmp/simple.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
3 | main()
| ^~~~
smartos-build-2(~/gcc10-shadow)[0]% echo "__xpg4/X" | mdb /tmp/simple
simple`__xpg4:
simple`__xpg4: 1
smartos-build-2(~/gcc10-shadow)[0]%
AND ON OMNIOS TOO!
# uname -a
SunOS bloody 5.11 omnios-master-1b78ae4a16 i86pc i386 i86pc
# gcc --version
gcc (OmniOS 151041/10.3.0-il-1) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# gcc -o /tmp/simple /tmp/simple.c
/tmp/simple.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
3 | main()
| ^~~~
# echo "__xpg4/X" | mdb /tmp/simple
simple`__xpg4:
simple`__xpg4: 1
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment