I'm trying to suggest that GCC should have error codes to describe
errors, continue reading on if you like the idea or not ;-)

THE IDEA:
The idea is to make GCC better when it comes to error reporting. This
will be done using so called error codes which then can be looked up
in a properly
formatted document to see what the error means when in confusion. This
will save time when it comes to searching what a error means around
and improve usability.

ERROR CODE FORMAT:

The way errors are shown is as follow:

for example instead of:
"ISO C forbids specifying range of elements to initialize"

you get:
"c742: ISO C forbids specifying range of elements to initialize"

Note that this error code is random i want to avoid this by a
numbering system as follows:

The numbering starts from x100 and goes on from there, there will be
no particular error code pattern because its to late for that rather
it will
start with warning() in alphabetic order of the source file names.

so in a file called aaa.c the first warning will be x100 and then the
second warning x101 until all warnings are numbered the next source
file gets numbered.

The order is:
warning()
error()
pedwarn()
(and pedwarn_c99())

From there on if warning or errors are added the numbering goes up so
it wont be arranged anymore.
The `x' prefix will indicate what language for C++ specif
errors/warning it should differ from the C prefix.

ERROR CODE DOCUMENT:

To document error codes there needs to a be a format. It will look
very familiar for those who have been reading/making man pages as well
;-)

These are the sections:

*ERROR                 Code of the error.
*DESCRIPTION      Describe the error.
*EXAMPLES           Show a pseudo-code example on how you should not do it
                              but how to do it instead. (if needed)
*SEE ALSO            Show error codes that looks similar.
*SUPPORT             If the document is not complete ask for help.
*DISCLAIMER         Explain that it is provided ``as is''

Note: DISCLAIMER should be the same in all error code documents.

PROBLEMS:

1.) Its almost impossible to let this feature being enabeld/disabled
using compiler flags.
2.) The amount of warnings, errors and pedantic warnings is so high it
will take a _lot_ of time to complete.
3.) This wont stop, feature code that's uses functions like pedwarn()
needs to follow guid-lines or it needs to be maintained.
5.) There are people who are going scream that its a lame idea.

NOTE:

This "draft" is meant to give you a view on what the idea is there are
probably errors in it. Please don't take this as a insult or something
because it's a idea to improve GCC to my opinion. If you don't agree
then please say so and why! And suggestions are welcome ;-)

-- Rubicant Rubicant

Reply via email to