This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Build failure on sysv5uw7.1.0: wchar_t typedefs in headers.
- To: RDBrown at mira dot net, RodneyBrown at mynd dot com
- Subject: Re: Build failure on sysv5uw7.1.0: wchar_t typedefs in headers.
- From: Bruce Korb <bkorb at cruzio dot com>
- Date: Wed, 24 Jan 2001 15:18:54 -0800
- CC: Roger Collins <roger at proproject dot com>, gcc-bugs at gcc dot gnu dot org, libstdc++ at sources dot redhat dot com
- References: <E14LiRl-0000AJ-00@urtur>
RDBrown@mira.net wrote:
>
> > Found this in gcc/fixinc/inclhack.def. Wonder why this did this not fix
> > the problem?
>
> > /*
> > * For C++, avoid any typedef definition of wchar_t,
> > * and use the built in type instead.
> > */
> > fix = {
> > hackname = avoid_wchar_t_type;
> > select = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;";
> > c_fix = format;
> > c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
> > test_text = "...";
> > };
I need to see the problem text. If the select regular expression
is in the relevant header, and the header is not among the set
of exempt header files, then the "c_fix_arg" should do its thing.
So, please send me the name of the file that is failing and a copy
of the failing-to-be-fixed text + a few lines of context, please :-).
> ...I tried just switching Unixware 7 over to using the
> fixincl.sh script but found that the changes to introduce __STRICT_ANSI__
> were required. inclhack.def has an #ifdef STRICT_ANSI that may suffice,
> but I haven't pursued it (& need to check the uw7 usage matches the
> patterns).
You must be alluding to this:
> /*
> * Check for strict ansi compliance
> */
> #ifdef STRICT_ANSI
> fix = {
> hackname = strict_ansi;
> select = "__STDC__[ \t]*[=!]=[ \t]*[01]";
> sed = "s/__STDC__[ \t]*==[ \t]*0/!defined (__STRICT_ANSI__)/g";
> sed = "s/__STDC__[ \t]*!=[ \t]*0/defined (__STRICT_ANSI__)/g";
> sed = "s/__STDC__[ \t]*==[ \t]*1/defined (__STRICT_ANSI__)/g";
> sed = "s/__STDC__[ \t]*!=[ \t]*1/!defined (__STRICT_ANSI__)/g";
> };
> #endif
which will basically fix more variations of:
> /*
> * "!__STDC__" is "!defined( __STRICT_ANSI__ )"
> */
> fix = {
> hackname = sco_strict_ansi;
> mach = "i?86-*-sco3.2*";
> select = "^[ \t]*#[ \t]*if.*!__STDC__";
>
> c_fix = format;
> c_fix_arg = "%1defined(__STRICT_ANSI__)%2";
> c_fix_arg = "^([ \t]*#[ \t]*if[ \t].*!)__STDC__(.*)";
>
> test_text = "#if !__STDC__ /* not standard C */\nint foo;\n#endif";
> };
The ``strict_ansi'' hack was likely derived from the fixinc.svr4
script and never activated because it was not needed as long as
SVr4's continued to use the script. Given that I have since added
the `c_fix' hackery, I would recommend a re-implementation of both
of these hacks along the lines of:
> /*
> * "!__STDC__" or "__STDC__==0" or "__STDC__!=1"
> * is "!defined( __STRICT_ANSI__ )"
> */
> fix = {
> hackname = strict_ansi_not;
> select = "^([ \t]*#[ \t]*if.*)"
> "(!__STDC__"
> "|__STDC__[ \t]*==[ \t]*0"
> "|__STDC__[ \t]*!=[ \t]*1"
> ")(.*)";
>
> c_fix = format;
> c_fix_arg = "%1 !defined(__STRICT_ANSI__)%3";
>
> test_text = "#if !__STDC__ /* not std C */\nint foo;\n#endif";
> };
>
> /*
> * "__STDC__!=0" or "__STDC__==1"
> * is "defined( __STRICT_ANSI__ )"
> */
> fix = {
> hackname = strict_ansi_only;
> select = "^([ \t]*#[ \t]*if.*)"
> "(__STDC__[ \t]*!=[ \t]*0"
> "|__STDC__[ \t]*==[ \t]*1"
> ")(.*)";
>
> c_fix = format;
> c_fix_arg = "%1 defined(__STRICT_ANSI__)%3";
>
> test_text = "#if __STDC__ == 1 /* is std C\n */\nint foo;\n#endif";
> };
> ... should we try to hack in the
> avoid_wchar_t_type change into fixincl.svr4 or have a varient
> routine that builds the C program with -DSTRICT_ANSI to get the SVR4
> __STRICT_ANSI__ edifice in? Do we need autogen to do so?
The "#ifdef" was used to turn the thing into a comment.
A special variant would force the installation of AutoGen for
UW builders of GCC. Probably would not fly :-) (Especially
since the templates are for the old variation of AutoGen :-).
You will need the 4.x AutoGen (from the infrastructure directory,
or from http://download.sourceforge.net/AutoGen/autogen-4.5.12.tar.gz
but you should only need it to test these "strict_ansi" hacks.
Once debugged, you check in a new inclhack.def and fixincl.x
files and everyone will be on the same page and AutoGenning would
not be needed.