This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Gcc error handling
- From: Philip Herron <herron dot philip at googlemail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 22 Mar 2009 21:10:58 +0000
- Subject: Gcc error handling
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey
This is just a basic question of the internal compliation.
So say you have a small program that prints like this:
char *mystr= "mystring";
printf("%s\n", mystr);
but if you were to have had
printf("%c\n",mystr);
gcc would throw up a compliation warning:
warning: format â%câ expects type âintâ, but argument 2 has type âchar *â
Just wondering what kind of gcc macro checks for that something like
printf(const char* fmt, ...)
is there a macro to go through the fmt and va_list of the different
types. But then its intereasting if you have something like:
int x= 10000000000;
printf("%i\n", x);
it will also warn me that x is too big to be an int. I guess its marco
trickery but maby it isnt a macro maby a gcc internal compilation for
the 2nd case because when running gdb on apps printf goes to a macro a
check i think cant remember.
Anyways i am not even sure if i have a question at the moment but any
guidance would be cool :)
- -Phil
http://redbrain.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAknGqV4ACgkQAhcOgIaQQ2HfbwCgh8d7DWTwLa0xOPLtGpb3+j55
NfIAmwSZx0Z2vi6ZpHMqcVj1dhIp0/ql
=EtgE
-----END PGP SIGNATURE-----