D
David Mathog
Sometimes when editing a source file a close brace is accidentally
deleted, and when that happens, at least with gcc, the error messages
are not very helpful in locating the error. Error messages are
generated from code below it, although not necessarily very near to
it, going on sometimes to the end of the file, thousands of lines
later. These errors can propagate through dozens of functions. Which
makes me wonder if there is something in the standard like:
#endfunction
to tell the compiler that if there is anything dangling in a function
at that point to throw an error there, and to start over cleanly below
the compiler directive. So that when
void somefunc(void){
/* bunch of stuff, including one too few "}" */
}
#endfunction
it will be clear from the messages that the problem is in somefunc().
In some instances I have had to emulate this by cutting off large
chunks of a file with
#ifdef NOTDEFINED
until the code is small enough to find the error.
Thanks,
David Mathog
deleted, and when that happens, at least with gcc, the error messages
are not very helpful in locating the error. Error messages are
generated from code below it, although not necessarily very near to
it, going on sometimes to the end of the file, thousands of lines
later. These errors can propagate through dozens of functions. Which
makes me wonder if there is something in the standard like:
#endfunction
to tell the compiler that if there is anything dangling in a function
at that point to throw an error there, and to start over cleanly below
the compiler directive. So that when
void somefunc(void){
/* bunch of stuff, including one too few "}" */
}
#endfunction
it will be clear from the messages that the problem is in somefunc().
In some instances I have had to emulate this by cutting off large
chunks of a file with
#ifdef NOTDEFINED
until the code is small enough to find the error.
Thanks,
David Mathog