Trigraph warnings

From: Mike Castle (dalgoda@ix.netcom.com)
Date: Mon Jun 19 2000 - 15:52:00 EST


[Peripheral interest to both linux-kernel and bug-cvs. Please watch your
followups.]

There was recent discussion on linux-kernel regarding recent changes in gcc
(yet unreleased 2.96, I believe) that flags trigraphs as warnings even when
-trigraphs is not enabled. Specifically, inside of comments.

Well, gcc is not the first to do this. Just got this happy little warning
on an NCR system:

        cc -I. -I.. -I. -I../lib -DHAVE_CONFIG_H -c login.c
NCR High Performance C Compiler R3.0c
(c) Copyright 1994-97, NCR Corporation
(c) Copyright 1987-97, MetaWare Incorporated
w "login.c",L54/C46(#684):
| Trigraph "??)" detected but not replaced; turn on TRIGRAPHS toggle.
No errors 1 warning

And the area in question is:

        /* FIXME? This message confuses a lot of users, at least
           on Win95 (which doesn't set HOMEDRIVE and HOMEPATH like
           NT does). I suppose the answer for Win95 is to store the
           passwords in the registry or something (??). And .cvsrc
           and such too? Wonder what WinCVS does (about .cvsrc, the
           right thing for a GUI is to just store the password in
           memory only)... */

And look, I didn't even ask for warnings!

For the cvs folk, beware, if someone starts building cvs with test versions
of gcc, they might question similar warnings (though the gcc folk said they
will disable trigraphs inside of comments once they teach trigraph code about
comments).

For the linux-kernel folk, I didn't see in the discussion mention of other
compilers that do similar tricks. Just thought I'd point one out to add
fuel to the fire. (Personally, I'd recommend removing the offending items,
just to enforce good programming skills. Just because the kernel may use
gcc extensions, it would not be a bad idea to keep such things to a minimum
so as less likely to slip into using those things on other projects. I've
dealt with compilers that did trigraphs by default, and been bit.)

mrc

-- 
       Mike Castle       Life is like a clock:  You can work constantly
  dalgoda@ix.netcom.com  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:17 EST