develooper Front page | perl.perl5.porters | Postings from May 2018

[perl #133152] Cygwin build failure with v5.27.11-16-g71e845c342

Thread Previous | Thread Next
Tony Cook via RT
May 3, 2018 01:13
[perl #133152] Cygwin build failure with v5.27.11-16-g71e845c342
Message ID:
On Wed, 02 May 2018 11:56:02 -0700, wrote:
> "Tony Cook via RT" writes:
> > 1) cygwin declares fgetws() when stdlib.h is included, but that name
> > isn't reserved to the implementation unless wchar.h is included (C11
> > 7.1.3)
> >
> > So a C program that defines a fgetws() function but doesn't include
> > wchar.h would be conforming, but this would break if stdlib.h is
> > included, making cygwin non-conforming.
> >
> > But I wouldn't be too surprised to find other implementations leak in
> > similar ways.
> For starters, unless you request strict POSIX/ANSI behaviour from the
> compiler, that line of argumentation can't be conclusive.  IIRC, you've
> been compiling with GNU_SOURCE at least, so that may already poke holes
> in the conformance.  Anyway, whether there is a bug or not I can't
> really tell myself and will defer to Yaakov or Eric, who are the Cygwin
> experts on these topics.

You're probably right - I only tested within the perl build, and didn't test a strict ANSI build. 

> > 2) Perl includes wchar.h which uses the FILE type (you're meant to
> > #include stdio.h to use the I/O functions with the C standard[2], but
> > POSIX requires wchar.h to define the FILE type), but nostdio.h defines
> > a macro FILE, using a named reserved to the implementation[1].
> >
> > I think the real fix is probably to eliminate nostdio.h - its use of
> > reserved names leads to random issues as we update perl and as
> > platforms update their implementations.
> >
> > The attached patch doesn't remove nostdio.h, it just prevents perlio.h
> > from including it.
> What is nostdio.h useful for anyway?  Just asking.

From the header itself:

 * Strong denial of stdio - make all stdio calls (we can think of) errors
/* This is a 1st attempt to stop other include files pulling
   in real <stdio.h>.
   A more ambitious set of possible symbols can be found in
   sfio.h (inside an _cplusplus gard).
   It is completely pointless as we have already included it ourselves.

I assume it was more justifiable when PerlIO was new to enforce perl's implementation using PerlIO rather than stdio.


via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About