[Bug 275508] sysutils/bsdisks: ensure uid_t is declared (else potential build error)

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 03 Dec 2023 16:35:35 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275508

            Bug ID: 275508
           Summary: sysutils/bsdisks: ensure uid_t is declared (else
                    potential build error)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: arrowd@FreeBSD.org
          Reporter: jcfyecrayz@liamekaens.com
             Flags: maintainer-feedback?(arrowd@FreeBSD.org)
          Assignee: arrowd@FreeBSD.org

sysutils/bsdisks is failing to compile on 12.x

blockfilesystem.h should include sys/types.h as it references uid_t.

It's luck that it compiles on 13.x (due to the way system include files just
happen to be written).

POSIX states that uid_t is defined in sys/types.h
Look for uid_t in these references:

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pwd.h.html

As it turns out changes to sched.h resulted in getting uid_t defined for
blockfilesystem.h on 13.x


compile error:

FAILED: CMakeFiles/bsdisks.dir/blockfilesystem.cpp.o
/usr/bin/c++ -DINSTALL_PREFIX=\"/usr/local\" -DQT_CORE_LIB -DQT_DBUS_LIB
-DQT_NO_DEBUG -I/usr/ports/sysutils/bsdisks/work/.build
-I/usr/ports/sysutils/bsdisks/work/bsdisks-7472fc29bafb5cf44c539131d566fbe541b7fd7d
-I/usr/ports/sysutils/bsdisks/work/.build/bsdisks_autogen/include -isystem
/usr/local/include/qt5 -isystem /usr/local/include/qt5/QtDBus -isystem
/usr/local/include/qt5/QtCore -isystem /usr/local/lib/qt5/mkspecs/freebsd-clang
-isystem /usr/local/include/polkit-qt5-1 -O2 -pipe -fstack-protector-strong
-fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  
-DNDEBUG -std=gnu++17 -fPIC -pthread -MD -MT
CMakeFiles/bsdisks.dir/blockfilesystem.cpp.o -MF
CMakeFiles/bsdisks.dir/blockfilesystem.cpp.o.d -o
CMakeFiles/bsdisks.dir/blockfilesystem.cpp.o -c
/usr/ports/sysutils/bsdisks/work/bsdisks-7472fc29bafb5cf44c539131d566fbe541b7fd7d/blockfilesystem.cpp
In file included from
/usr/ports/sysutils/bsdisks/work/bsdisks-7472fc29bafb5cf44c539131d566fbe541b7fd7d/blockfilesystem.cpp:30:
/usr/ports/sysutils/bsdisks/work/bsdisks-7472fc29bafb5cf44c539131d566fbe541b7fd7d/blockfilesystem.h:54:29:
error: use of undeclared identifier 'uid_t'
    QList<QPair<QByteArray, uid_t>> mountPoints;
                            ^
/usr/ports/sysutils/bsdisks/work/bsdisks-7472fc29bafb5cf44c539131d566fbe541b7fd7d/blockfilesystem.h:60:56:
error: use of undeclared identifier 'uid_t'
    void unmountImplementation(QList<QPair<QByteArray, uid_t>>::iterator it,
bool force, bool changed, std::shared_ptr<DBusSavedContext> context);
                                                       ^
/usr/ports/sysutils/bsdisks/work/bsdisks-7472fc29bafb5cf44c539131d566fbe541b7fd7d/blockfilesystem.cpp:218:23:
error: out-of-line definition of 'unmountImplementation' does not match any
declaration in 'BlockFilesystem'
void BlockFilesystem::unmountImplementation(QList<QPair<QByteArray,
uid_t>>::iterator it, bool force, bool changed,
std::shared_ptr<DBusSavedContext> context)
                      ^~~~~~~~~~~~~~~~~~~~~
/usr/ports/sysutils/bsdisks/work/bsdisks-7472fc29bafb5cf44c539131d566fbe541b7fd7d/blockfilesystem.cpp:380:33:
error: cannot initialize object parameter of type 'const QObject' with an
expression of type 'BlockFilesystem'
    return qobject_cast<Block*>(parent());
                                ^~~~~~
4 errors generated.
ninja: build stopped: subcommand failed.

-- 
You are receiving this mail because:
You are the assignee for the bug.