Skip to content
Snippets Groups Projects

include <sys/types.h> where uint is used

Merged Jakub Jirůtka requested to merge (removed):fix-sys-types into master

Compilation fails on gcc 6.3.0 and musl libc:

g++ -pipe -std=c++11 -O3 -DNDEBUG -DRELEASE -c -Wall -pedantic -Wextra -Werror \
  -Wshadow -Wpointer-arith -Wcast-qual -Wdelete-non-virtual-dtor \
  -Wredundant-decls -fPIC \
  ... \
  alib2algo_experimental/src/graph/spanningtree/Kruskal.cpp \
  -o alib2algo_experimental/obj-release/graph/spanningtree/Kruskal.o
In file included from alib2algo_experimental/src/graph/spanningtree/Kruskal.cpp:15:0:
alib2algo_experimental/src/graph/spanningtree/../datastructs/Components.h:74:3: error: 'uint' does not name a type
   uint parent;
   ^~~~

This type is defined in sys/types.h when _GNU_SOURCE or _BSD_SOURCE is defined (at least in musl libc). Please note that uint is not specified in C++ standard and should not be used...

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
Please register or sign in to reply
Loading