@related : GNU ProgrammingTool Compiler C C++ Java MSVC GCJ gxx g++

ToDo

g++ a [[Libre]] [[C++]] [[Compiler]]

g++ -std=c++98 -fno-gnu-keywords -ffor-scope -Wall -pedantic -W  \
   *Wold-style-cast -Woverloaded-virtual -Wsign-promo -Wundef \
   *Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Winline \
   *Wdisabled-optimization -O2

SOFTWARE

GCC

Control warnings

#pragma warning(disable: 985) // identifier truncated in debug

http://gcc.gnu.org/onlinedocs/gcc-3.4.0/gcc/Warning-Options.html#Warning%20Options

http://gcc.gnu.org/ml/gcc/1998-09/msg00446.html

tells version, macro etc

# gcc -v -E -march=i686 - # on SunOS
Reading specs from  /usr/local/gcc-2.8.1/lib/gcc-lib/sparc-sun-solaris2.7/2.8.1/specs
gcc version 2.8.1
/usr/local/gcc-2.8.1/lib/gcc-lib/sparc-sun-solaris2.7/2.8.1/cpp -lang-c -v
*undef -D**GNUC**=2 -D__GNUC_MINOR__=8
*Dsparc -Dsun -Dunix -D**svr4** -D**SVR4 -D**sparc** -D**sun__
*D**unix** -D**svr4** -D**SVR4 -D**sparc -D**sun -D**unix
*Asystem(unix) -Asystem(svr4) -D__GCC_NEW_VARARGS__
*Acpu(sparc) -Amachine(sparc) -
GNU CPP version 2.8.1 (sparc)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/gcc-2.8.1/sparc-sun-solaris2.7/include
/usr/local/gcc-2.8.1/lib/gcc-lib/sparc-sun-solaris2.7/2.8.1/include
/usr/include
End of search list.

about the only common versioning you get is the :

**STDC** def
__cplusplus is the equivalent for C++

With an optimized compiler, I specifically used:

  • O3 -pipe -fomit-frame-pointer -funroll-loops
  • march=pentium3 -mcpu=pentium3 -mfpmath=sse -mmmx -msse

GCC Warnings

http://icecube.wisc.edu/~dglo/gcc-warnings.html

snprintf :

 too many arguments for format
 unknown conversion type character 'l' in format

http://stackoverflow.com/questions/2844/how-do-you-printf-an-unsigned-long-long-int

$FILE.h:71: warning: '$CLASS' has a field '$CLASS::$MEMBER' whose type uses the anonymous namespace

GCC errors

incompatible types in assignment
cannot convert to a pointer type

Make sure you're passing address with '&'

sorry, unimplemented: inlining failed in call to '': function body not available

LD

g++ error:

 "error: too few template-parameter-lists"

http://boost.2283326.n4.nabble.com/String-literals-concatenation-issue-when-using-BOOST-CURRENT-FUNCTION-td2649819.html

  error: expected ')' before '__PRETTY_FUNCTION__'

@tag: preprocessor

"fatal error: asm/errno.h: No such file or directory"

https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/825574

sudo aptitude install g++-4.6-multilib
sudo ln -fs asm-generic /usr/include/asm

g++ warning:

 warning: dereferencing type-punned pointer will break strict-aliasing rules

http://gcc.gnu.org/ml/gcc-help/2007-07/msg00294.html

https://secure.wikimedia.org/wikipedia/en/wiki/Type_punning

ERRORS

"error: invalid use of incomplete type "
"error: forward declaration of"

http://stackoverflow.com/questions/1915759/forward-declaration-and-typeid

"undefined reference to `typeinfo for "

http://stackoverflow.com/questions/307352/g-undefined-reference-to-typeinfo

MISC

ed2k://|file|gcc-core-3.4.4-20050522-1.tar.gz|3523621|0e5c68b313769e497a4ccb75330a6c96|
ed2k://|file|gcc-g++-3.4.4-20050522-1.tar.gz|4705756|475bbdbaff41498d24d227ed7061ab7f|
ed2k://|file|gcc-java-3.4.4-20050522-1.tar.gz|16162510|dce1485a3515182847f35a7ab76ff7cb|
* http://www.network-theory.co.uk/docs/gccintro/gccintro_71.html# [[type]]s

MORE

gcc.txt · Last modified: 2013/09/04 22:01 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki