Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Include sys/sysmacros.h for to fix build - #5

#5
Open
paulmenzel wants to merge 1 commit into
chris-se:masterchris-se/tiny-initramfs:masterfrom
paulmenzel:include-sysmacros.h-to-fix-buildpaulmenzel/tiny-initramfs:include-sysmacros.h-to-fix-buildCopy head branch name to clipboard
Open

Include sys/sysmacros.h for to fix build#5
paulmenzel wants to merge 1 commit into
chris-se:masterchris-se/tiny-initramfs:masterfrom
paulmenzel:include-sysmacros.h-to-fix-buildpaulmenzel/tiny-initramfs:include-sysmacros.h-to-fix-buildCopy head branch name to clipboard

Conversation

@paulmenzel

Copy link
Copy Markdown

Tested on Debian sid/unstable.

Building the source on Debian sid/unstable with libc6 2.31-5 and UUID support
(default) results in the build failure below.

      CC       tiny_initramfs-devices.o
      CC       tiny_initramfs-util.o
    devices.c: In function 'scan_devices':
    devices.c:290:15: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration]
      290 |           if (major(st.st_rdev) == maj && minor(st.st_rdev) == min) {
          |               ^~~~~
    devices.c:290:33: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
      290 |           if (major(st.st_rdev) == maj && minor(st.st_rdev) == min) {
          |                                 ^~
    devices.c:290:43: warning: implicit declaration of function 'minor' [-Wimplicit-function-declaration]
      290 |           if (major(st.st_rdev) == maj && minor(st.st_rdev) == min) {
          |                                           ^~~~~
    devices.c:290:61: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
      290 |           if (major(st.st_rdev) == maj && minor(st.st_rdev) == min) {
          |                                                             ^~
      CCLD     tiny_initramfs
    /usr/bin/ld: tiny_initramfs-devices.o: in function `scan_devices':
    devices.c:(.text+0x520): undefined reference to `major'
    /usr/bin/ld: devices.c:(.text+0x539): undefined reference to `minor'
    collect2: error: ld returned 1 exit status
    make[1]: *** [Makefile:398: tiny_initramfs] Error 1

Explicitly include the header `sys/sysmacros.h`, where `major()` and `minor()`
are defined.

Resolves: chris-se#4
@paulmenzel
paulmenzel force-pushed the include-sysmacros.h-to-fix-build branch from 2395f5b to f504663 Compare December 9, 2020 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.