Hi,
I could not find a site that has list of gcc warnings and errors and provide some explanation on each one.
Is there such thing?
Hi,
I could not find a site that has list of gcc warnings and errors and provide some explanation on each one.
Is there such thing?
Recently discussed here:
http://cboard.cprogramming.com/showthread.php?t=94184
The conclusion is "no there isn't".
I personally think that almost all of GCC's warnings and errors are pretty easy to understand (although there are some exceptions). Feel free to post errors/warnings and ask questions. It is obviously helpfull if you can provide the relevant source-code too, as that will certainly help the explaining of what's wrong in your code.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Thanks,
I just wished I could add to my firefox search engine list a search engine to look for errors of gcc.
I have one for MSDN and if I enter there the error/warning number I am directed to a nice page with a lot of info and examples.
but I found out that googling for the error will provide me with a satisfying answer as well. it just take a couple of minutes longer.
But that will do.
I think there is another problem (besides cryptic error messages).
When there is an error, the compiler can easily get confused. It doesn't know what you are trying to do... It just knows it can't interpret the code. (This can happen with any compiler)
For example, once when I was moving some code around by "cutting & pasting", I mis-placed a bracket. There was only one little-tiny syntax error, but the compiler reported a couple-hundred errors and none of them said "mis-placed bracket". (It took me a few hours to find that little-tiny problem!)
Usually, the first error message identifies the line with the first error (or the real error is usually one line up or down), but beyond that, the compiler is often just confused.
Linker messages can be a bit more difficult, because you've lost the line-number information.
When the compiler gives you a warning, it's probably nailed the real problem... It hasn't given-up completely.... It (probably) knows what you are trying to do, and it's warning you that it might be risky.
Last edited by DougDbug; 10-10-2007 at 04:19 PM.
Doug,
I completely agree - if you get hundreds or thousands of errors, it's most likely caused by an error at the beginning of the list [and, yes, if you are missing a bracket at teh end of a function, that can lead to all sorts of "strange" error messages].
Unfortunately, a "further explanation" will not really help there - unless you add to the "nested function declarations isn't valid in standard C" with "This usually means that you forgot a bracket" - and of course, that's not necessarily the error that you get from missing a bracket, as it can lead to lots of other errors. Unfortunately, this is one of those that you have to figure out with another method. Using the "automatically indent the code" will quickly tell you about a missing end bracket. But there are ohter missing bits that can cause equal confusion and distress - missing semicolon, particularly on type declarations can lead to strange error messages too.
Absolute general rule: Try fixing the first error first.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
True. Over time you build experience with these things. "Error ABC actually means I forgot a semicolon at the end of a struct definition," etc. It would be nice if there was a list of "common causes" of such errors, but I haven't found one. In truth I've seen them enough that I know what they are, and I don't make those mistakes very often.
In general if you've got hundreds of warnings/errors, there are actually only one or two. Look at the first one, try to fix it, then recompile and see what you get.
If you compile with debugging information, often the linker CAN report an exact line number.Linker messages can be a bit more difficult, because you've lost the line-number information.