This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: aggressive fixincludes
- To: gcc-bugs at gcc dot gnu dot org, mark at codesourcery dot com, autogen at linuxbox dot com
- Subject: Re: aggressive fixincludes
- From: korbb at sourceware dot cygnus dot com
- Date: Tue, 23 Nov 1999 11:45:49 -0800 (PST)
- Reply-To: "Bruce Korb" <ddsinc09 at ix dot netcom dot com>
Mark Mitchell wrote:
>
> >>>>> "korbb" == korbb <korbb@sourceware.cygnus.com> writes:
>
> korbb> Sure. Tell me how to identify the fact that "FlexLexer.h"
> korbb> is a C++ file.
>
> One thing I am concerned about is that fixincluded files to not get
> updated when packages get updated. So, to prevent skew, we should
> keep the number of fixincluded files to a minimum, even if the fixes
> do not in any way break the file.
I also prefer to reduce clutter....
> As for a solution, finding an `extern "C++"' is a good hint it's not C
> file. (`extern "C"' might appear in a C header that can be included
> from C++, but `extern "C++"' is much less likely.) That would cover
> FlexLexer.h.
>
> And anything in /usr/include/g++* (g++,g++-2,g++-3) should be excluded
> from this test, as those are C++ files.
Current code:
/* First, check to see if the file is in a C++ directory */
if (strstr( fname, "CC/" ) != NULL)
return SKIP_FIX;
if (strstr( fname, "xx/" ) != NULL)
return SKIP_FIX;
if (strstr( fname, "++/" ) != NULL)
return SKIP_FIX;
How about changing the last test to:
if (strstr( fname, "++" ) != NULL)
return SKIP_FIX;
and adding:
if (strstr( text, "extern \"C++\"" ) != NULL)
return SKIP_FIX;
=========
As for the ^M stuff, I liked it because it did not cause
interesting stuff to scroll off the screen.