Skip to content
Snippets Groups Projects
Commit eab1684b authored by Jan Trávníček's avatar Jan Trávníček
Browse files

Merge branch 'fix-sys-types' into 'master'

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

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...

See merge request !23
parents a4c2f69b a623289d
No related branches found
No related tags found
1 merge request!23include <sys/types.h> where uint is used
......@@ -8,6 +8,8 @@
#ifndef BINOMIAL_HEAP_INCLUDED
#define BINOMIAL_HEAP_INCLUDED
 
#include <sys/types.h>
#include <stdexcept>
 
/// binomial heap used as mergeable priority queue
......
......@@ -5,6 +5,8 @@
* Author: Jan Broz
*/
 
#include <sys/types.h>
#include <unordered_map>
 
#include <graph/common/Node.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment