The change should not unintentionally affect existing tests.

The new test should be exactly the text that "make check" produces, not
what you think it should look like and not like another, neighboring test.
If the test doesn't look as you expect, you need to examine your test text.

You also can try to ask Bruce Korb for some advice. Few modern targets
require fixincludes.

Thanks, David

On Wed, Aug 15, 2018 at 4:38 PM Albert Chin <g...@mlists.thewrittenword.com>
wrote:

> On Wed, Aug 15, 2018 at 03:52:33PM -0400, David Edelsohn wrote:
> > You must manually insert the additional test lines into the appropriate
> > file in fixincludes/tests/base and then retest.
> >
> > Please see step (6) in fixincludes/README
>
> Ok, thanks. fixincludes/tests/res/stdlib.h has:
>   #if defined( HPUX_LONG_DOUBLE_CHECK )
>   extern long double strtold(const char *, char **);
>
>   #endif  /* HPUX_LONG_DOUBLE_CHECK */
>
>   #if defined( HPUX_LONG_DOUBLE_2_CHECK )
>   #  if !defined(__ia64) || !defined(_PROTOTYPES) ||
> defined(_LONG_DOUBLE_STRUCT)
>
>   #endif  /* HPUX_LONG_DOUBLE_2_CHECK */
>
> The body of HPUX_LONG_DOUBLE_2_CHECK is no longer valid with my fix.
> I'm thinking it should look like HPUX_LONG_DOUBLE_CHECK so I modified
> HPUX_LONG_DOUBLE_2_CHECK to look like HPUX_LONG_DOUBLE_CHECK.
>
> However, when I run "make check", fixincludes/tests/res/stdlib.h has:
>   #if defined( HPUX_LONG_DOUBLE_2_CHECK )
>
>   #endif  /* HPUX_LONG_DOUBLE_2_CHECK */
>
> So, I modified test_text to the following:
>     test_text = "#  ifndef _LONG_DOUBLE\n"
>                 "#    define _LONG_DOUBLE\n"
>                 "     typedef struct {\n"
>                 "       unsigned int word1, word2, word3, word4;\n"
>                 "     } long_double;\n"
>                 "#  endif /* _LONG_DOUBLE */\n"
>                 "extern long_double strtold(const char *, char **);\n";
> rather than:
>     test_text = "#  ifndef _LONG_DOUBLE\n"
>                 "#    define _LONG_DOUBLE\n"
>                 "     typedef struct {\n"
>                 "       unsigned int word1, word2, word3, word4;\n"
>                 "     } long_double;\n"
>                 "extern long_double strtold(const char *, char **);\n"
>                 "#  endif /* _LONG_DOUBLE */\n";
>
> and modified fixincludes/tests/base/stdlib.h to:
>   #if defined( HPUX_LONG_DOUBLE_CHECK )
>   extern long double strtold(const char *, char **);
>
>   #endif  /* HPUX_LONG_DOUBLE_CHECK */
>
>
>   #if defined( HPUX_LONG_DOUBLE_2_CHECK )
>   extern long double strtold(const char *, char **);
>
>   #endif  /* HPUX_LONG_DOUBLE_2_CHECK */
>
> I don't know why the change to test_text causes "make check" to
> succeed though.
>
> > Thanks, David
> >
> >
> >
> >
> > On Wed, Aug 15, 2018 at 3:46 PM Albert Chin <
> g...@mlists.thewrittenword.com>
> > wrote:
> >
> > > Hi. I've come up with a fixincl fix for PR86599 but "make check" in
> > > the fixincludes directory does not work and I do not know why. I know
> > > just enough fixincl-fu to produce a patch for this issue. I am trying
> > > to convert a chunk of code in stdlib on HP-UX 11.31/PA:
> > >
> > > #  ifndef _LONG_DOUBLE
> > > #    define _LONG_DOUBLE
> > > #  if !defined(__ia64) || !defined(_PROTOTYPES) ||
> > > defined(_LONG_DOUBLE_STRUCT)
> > > typedef struct {
> > >         uint32_t word1, word2, word3, word4;
> > >         } long_double;
> > > extern long_double strtold __((const char * __restrict, char **
> > > __restrict));
> > > #  else /* !__ia64 || !_PROTOTYPES || _LONG_DOUBLE_STRUCT */
> > > #    ifdef _INCLUDE_HPUX_SOURCE
> > > typedef long double long_double;
> > > #    endif /* _INCLUDE_HPUX_SOURCE */
> > > extern long double strtold __((const char * __restrict, char **
> > > __restrict));
> > > #  endif /* !__ia64 ||!_PROTOTYPES ||_LONG_DOUBLE_STRUCT */
> > > #endif /* _LONG_DOUBLE */
> > >
> > > to:
> > >
> > > extern long double strtold(const char *, char **);
> > >
> > > I am doing this by fixing hpux_long_double_2 so it now looks like:
> > > fix = {
> > >     hackname  = hpux_long_double_2;
> > >     mach      = "hppa*-*-hpux11.3*";
> > >     files     = stdlib.h;
> > >     select    = "extern[ \t]long_double[ \t]strtold";
> > >     bypass    = "long_double_t";
> > >     sed       = "/^#[ \t]*ifndef _LONG_DOUBLE/,"
> > >                 "/\\/\\* _LONG_DOUBLE \\*\\//c\\\n"
> > >                 "extern long double strtold(const char *, char **);\n";
> > >     sed       = "s/long_double/long double/g";
> > >
> > >     test_text = "#  ifndef _LONG_DOUBLE\n"
> > >                 "#    define _LONG_DOUBLE\n"
> > >                 "     typedef struct {\n"
> > >                 "       unsigned int word1, word2, word3, word4;\n"
> > >                 "     } long_double;\n"
> > >                 "extern long_double strtold(const char *, char **);\n"
> > >                 "#  endif /* _LONG_DOUBLE */\n";
> > > };
> > >
> > > This works but "make check" returns:
> > >
> > > stdlib.h /opt/build/gcc-8.2.0/fixincludes/tests/base/stdlib.h differ:
> char
> > > 1475, line 59
> > > *** stdlib.h    Wed Aug 15 19:38:37 2018
> > > --- /opt/build/gcc-8.2.0/fixincludes/tests/base/stdlib.h        Thu
> Feb 22
> > > 16:12:26 2018
> > > ***************
> > > *** 56,61 ****
> > > --- 56,62 ----
> > >
> > >
> > >   #if defined( HPUX_LONG_DOUBLE_2_CHECK )
> > > + #  if !defined(__ia64) || !defined(_PROTOTYPES) ||
> > > defined(_LONG_DOUBLE_STRUCT)
> > >
> > >   #endif  /* HPUX_LONG_DOUBLE_2_CHECK */
> > >
> > > There were fixinclude test FAILURES
> > >
> > > Any ideas?
> > >
> > > --
> > > albert chin (ch...@thewrittenword.com)
> > >
>
> --
> albert chin (ch...@thewrittenword.com)
>

Reply via email to