Gcc error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----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-----

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux