Silly C++ formatting of error messages.

Mo McKinlay mmckinlay@labs.interopen.org
Wed Apr 5 17:17:00 GMT 2000


I'm sorry, but you have to laugh at the error messages gcc produced :-)

# There was a discussion of truncating the file names by better
# communication between compiler and preprocessor. I don't know whether
# anything ever came out of this discussion, though.

Ack! Some pretty nifty comms would have to go on, else one could run into
some seriously confusing messages:

$ gcc module1/ident.c module2/ident.c
ident.c:3:Parse error before 'char'

Unlikely, but quite possible. The solution of not truncating errors if
filenames are above a certain length is more useful, IMHO. As a temporary
fix, see the recent messages on this list regarding a possible patch to
gcc to allow it to find out terminal widths - there was a command-line
option mentioned (which I can't remember off the top of my head) which
will have the ultimate effect of increasing the width of the terminal, as
far as gcc error-message production is concerned.

On this topic, it's concievable that there may be a few options of this
nature, which users may want as defaults. This may well have been
discussed before, but what about having a .gccrc file (or similar), which
specifies defaults for gcc? I know it opens up a new can of worms, but I
know of a lot of other (commercial) compilers which provide this facility,
and it could be useful. (i.e., the equivalent of doing gcc `cat ~/.gccrc`
$*).

Has this been considered before, and if not, is it worth persuing?

-- 
Mo McKinlay             Chief Software Architect              inter/open
mmckinlay@labs.interopen.org                    http://www.interopen.org



More information about the Gcc mailing list