c++/7338: Error message contains newline, breaks grep -v; warning from include/g++-v3/bits/stl_threads.h

sampo@symlabs.com sampo@symlabs.com
Wed Jul 17 07:26:00 GMT 2002


>Number:         7338
>Category:       c++
>Synopsis:       Error message contains newline, breaks grep -v; warning from include/g++-v3/bits/stl_threads.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 17 05:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sampo Kellomaki
>Release:        Reading specs from /apps/gcc/std/bin/../lib/gcc-lib/sparc-sun-solaris2.6/3.1/specs
>Organization:
>Environment:
SunOS aphrodite 5.6 Generic_105181-29 sun4u sparc SUNW,Ultra-5_10
>Description:
Newer versions of gcc have started emitting error and warning messages
that have embedded newlines. This is most unfortunate as
it makes it difficult to filter out unwanted bogus warnings
using grep -v. An example of such error message is

/apps/gcc/std/include/g++-v3/bits/stl_threads.h: At global scope:
/apps/gcc/std/include/g++-v3/bits/stl_threads.h: In instantiation of `__gthread_mutex_t std::_Swap_lock_struct<0>::_S_swap_lock':
/apps/gcc/std/include/g++-v3/bits/stl_threads.h:122:   instantiated from here
/apps/gcc/std/include/g++-v3/bits/stl_threads.h:115: warning: aggregate has a 
   partly bracketed initializer
/apps/gcc/std/include/g++-v3/bits/stl_threads.h:115: warning: aggregate has a 
   partly bracketed initializer

As can be seen "partly bracketed initializer" is on the next
line, thus complicating ignoring it. World will be better
place if error messages remain on single line. Existing
presentation level tools, such as the emacs compilation mode
are better places to do line wrapping and other formatting.

The above snippet also demonstrates another annoying
"feature", namely that the standard template library
headers that are shipped with gcc-3.1 actually are not
warning clean (on SunOS-5.6 anyway).
>How-To-Repeat:
On SunOS-5.6 machine with gcc-3.1 compiled as follows

cd build-gcc
../gcc-3.1/configure --prefix=/apps/gcc/std
make bootstrap-lean

say

/apps/gcc/std/bin/g++ -Wall -c test.cc
>Fix:
1. Zap the damn newlines from error and warning messages
2. fix include/g++-v3/bits/stl_threads.h
>Release-Note:
>Audit-Trail:
>Unformatted:
 Configured with: ./configure --prefix=/apps/gcc/3.1
 Thread model: posix
 gcc version 3.1
 
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"

LyogdGVzdC5jYyAgLSAgRGVtb3N0cmF0ZXMgY29tcGlsZXIgd2FybmluZyBpbiBpbmNsdWRlL2cr
Ky12My9iaXRzL3N0bF90aHJlYWRzLmgKICogMTcuNy4yMDAyLCBjcmVhdGVkLCBTYW1wbyBLZWxs
b23ka2kgPHNhbXBvQHN5bWxhYnMuY29tPgogKgogKiAvYXBwcy9nY2Mvc3RkL2Jpbi9nKysgLVdh
bGwgLWMgdGVzdC5jYwogKiAvYXBwcy9nY2Mvc3RkL2luY2x1ZGUvZysrLXYzL2JpdHMvc3RsX3Ro
cmVhZHMuaDogSW4gaW5zdGFudGlhdGlvbiBvZiBgX19ndGhyZWFkX211dGV4X3Qgc3RkOjpfU3dh
cF9sb2NrX3N0cnVjdDwwPjo6X1Nfc3dhcF9sb2NrJzoKICogL2FwcHMvZ2NjL3N0ZC9pbmNsdWRl
L2crKy12My9iaXRzL3N0bF90aHJlYWRzLmg6MTIyOiAgIGluc3RhbnRpYXRlZCBmcm9tIGhlcmUK
ICogL2FwcHMvZ2NjL3N0ZC9pbmNsdWRlL2crKy12My9iaXRzL3N0bF90aHJlYWRzLmg6MTE1OiB3
YXJuaW5nOiBhZ2dyZWdhdGUgaGFzIGEgCiAqICAgIHBhcnRseSBicmFja2V0ZWQgaW5pdGlhbGl6
ZXIKICogL2FwcHMvZ2NjL3N0ZC9pbmNsdWRlL2crKy12My9iaXRzL3N0bF90aHJlYWRzLmg6MTE1
OiB3YXJuaW5nOiBhZ2dyZWdhdGUgaGFzIGEgCiAqICAgIHBhcnRseSBicmFja2V0ZWQgaW5pdGlh
bGl6ZXIKCnVuYW1lIC1hClN1bk9TIGFwaHJ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