pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc-2018Q2: pkgtools/pkgin fails to build



I tried from within the plain pkgin source tree

$ ./configure CC=/usr/pkg/gcc49/bin/gcc
$ make CC=/usr/pkg/gcc49/bin/gcc

in my un-updated system, and that fails in the same manner (using that
compiler).
Weirdly enough, this:

$ make

uses gcc instead of /usr/pkg/gcc49/bin/gcc, even though CC is clearly
set already in the Makefile.

But that aside for now.

I used -E on the build command, and noticed that the original code


                for (ptr = buf; size > 0; ptr += wrote, size -= wrote) {
                        if ((wrote = fwrite(ptr, 1, size, fp)) < size) {
                                if (ferror(fp) && errno == EINTR)
                                        clearerr(fp);

gets expanded to

  for (ptr = buf; size > 0; ptr += wrote, size -= wrote) {
   if ((wrote = fwrite(ptr, 1, size, fp)) < size) {
    if ((((fp)->_flags & 0x0040) != 0) && (*__errno()) == 4)
     ((void)((fp)->_flags &= ~(0x0040|0x0020)));

That probably comes from

/usr/pkg/gcc49/lib/gcc/x86_64--netbsd/4.9.4/include-fixed/stdio.h:#define      __sclearerr(p)   ((void)((p)->_flags &= ~(__SERR|__SEOF)))
/usr/pkg/gcc49/lib/gcc/x86_64--netbsd/4.9.4/include-fixed/stdio.h:#define      clearerr(p)      __sclearerr(p)

and

        unsigned short _flags;  /* flags, below; this FILE is free if 0 */

That would explain the "conversion to 'short unsigned int' from 'int'
may alter its value".. even if the compiler actually KNOWS the value
here and can see that it doesn't matter.

The same macro definitions are in the normal <stdio.h> file, so this is
not some weird macro added by gcc.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- Wayland: Those who don't understand X
\X/ rhialto/at/falu.nl      -- are condemned to reinvent it. Poorly.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index