[bug #55526] FTBFS on GNU/kFreeBSD: NSWorkspace.m:1252:27: error: 'MOUNTED_PATH' undeclared

Yavor Doganov <[email protected]>
Newsgroups gmane.comp.lib.gnustep.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/bugs/?55526>

                 Summary: FTBFS on GNU/kFreeBSD: NSWorkspace.m:1252:27: error:
'MOUNTED_PATH' undeclared
                 Project: GNUstep
            Submitted by: yavor
            Submitted on: Sun 20 Jan 2019 06:57:10 PM EET
                Category: Gui/AppKit
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

GUI 0.27.0 fails to build on GNU/kFreeBSD with:


gcc NSWorkspace.m -c \
      -MMD -MP -Wdate-time -D_FORTIFY_SOURCE=2 -DGNUSTEP_TARGET_DIR=\".\"
-DGNUSTEP_TARGET_CPU=\"x86_64\" -DGNUSTEP_TARGET_OS=\"kfreebsd-gnu\"
-DLIBRARY_COMBO=\"gnu-gnu-gnu\" -DGNUSTEP_BASE_HAVE_LIBXML=1
-DBACKEND_BUNDLE=1 -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1
-DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions
-fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -pthread -fPIC -fPIC -Wall
-DGSWARN -DGSDIAGNOSE -Wno-import -g -O2 -g -O2
-fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat
-Werror=format-security -fgnu-runtime -Wall
-fconstant-string-class=NSConstantString -I../Headers/Additions -I../Headers
-I./. -I. -I/usr/local/include/GNUstep -I/usr/include/GNUstep -Wdate-time
-D_FORTIFY_SOURCE=2 -fopenmp -DMAGICKCORE_HDRI_ENABLE=0
-DMAGICKCORE_QUANTUM_DEPTH=16
-I/usr/include/x86_64-kfreebsd-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6
-I/usr/include/libpng16 \
       -o obj/libgnustep-gui.obj/NSWorkspace.m.o
NSWorkspace.m:71:4: warning: #warning "Mounted path file for you OS guessed to
/etc/mtab"; [-Wcpp]
 #  warning "Mounted path file for you OS guessed to /etc/mtab";
    ^~~~~~~
NSWorkspace.m: In function '-[NSWorkspace
getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:]':
NSWorkspace.m:1252:17: warning: implicit declaration of function 'setmntent';
did you mean 'getmntinfo'? [-Wimplicit-function-declaration]
   FILE  *fptr = setmntent(MOUNTED_PATH, "r");
                 ^~~~~~~~~
                 getmntinfo
NSWorkspace.m:1252:27: error: 'MOUNTED_PATH' undeclared (first use in this
function); did you mean 'AUDIT_PATH'?
   FILE  *fptr = setmntent(MOUNTED_PATH, "r");
                           ^~~~~~~~~~~~
                           AUDIT_PATH
NSWorkspace.m:1252:27: note: each undeclared identifier is reported only once
for each function it appears in
NSWorkspace.m:1255:16: warning: implicit declaration of function 'getmntent';
did you mean 'getmntinfo'? [-Wimplicit-function-declaration]
   while ((me = getmntent(fptr)) != 0)
                ^~~~~~~~~
                getmntinfo
NSWorkspace.m:1255:14: warning: assignment to 'struct mntent *' from 'int'
makes pointer from integer without a cast [-Wint-conversion]
   while ((me = getmntent(fptr)) != 0)
              ^
In file included from /usr/include/string.h:634,
                 from /usr/include/x86_64-kfreebsd-gnu/sys/mount.h:38,
                 from NSWorkspace.m:39:
NSWorkspace.m:1257:18: error: dereferencing pointer to incomplete type 'struct
mntent'
     if (strcmp(me->MNT_MEMB, [fullPath fileSystemRepresentation]) == 0)
                  ^~
NSWorkspace.m:1262:3: warning: implicit declaration of function 'endmntent'
[-Wimplicit-function-declaration]
   endmntent(fptr);
   ^~~~~~~~~
/usr/share/GNUstep/Makefiles/rules.make:479: recipe for target
'obj/libgnustep-gui.obj/NSWorkspace.m.o' failed


GNU/kFreeBSD provides both getmntinfo and getmntent but the conditionals
assume it's either one of them (as is the case on GNU/Linux where getmntinfo
is missing).

Please consider applying the attached obvious patch which has been tested on
Debian's GNU/kFreeBSD autobuilders.  (I believe you can do it with "git am".)



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 20 Jan 2019 06:57:10 PM EET  Name:
0001-Fix-build-failure-on-GNU-kFreeBSD.patch  Size: 1KiB   By: yavor

<http://savannah.gnu.org/bugs/download.php?file_id=46042>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55526>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.