lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

error while running make check (g++ 4.7.0): missing include of unistd.h


From: Frédéric Bron
Subject: error while running make check (g++ 4.7.0): missing include of unistd.h
Date: Wed, 11 Jul 2012 07:06:58 +0200

I wanted to run regression tests and compare before and after a change.
However, I obtained the error given below after make -j8 CPU_COUNT=8 check

I suspect this is because I am compiling with gcc/g++ 4.7.0 (coming
with Fedora 17) and its release notes say:
"Avoid polluting the global namespace and do not include <unistd.h>."
we should then include
       #include <sys/types.h>
       #include <unistd.h>
before using getpid and getcwd.

I include a patch for this that make the make check succeed.

Frédéric

In file included from
/home/fred/lilypond/flower/include/yaffut-parameters.hh:4:0,
                 from /home/fred/lilypond/flower/test-file-name.cc:3:
/home/fred/lilypond/flower/include/yaffut.hh: In member function 'int
yaffut::Factory::Main(int, const char**)':
/home/fred/lilypond/flower/include/yaffut.hh:211:39: warning:
conversion to 'int' from 'size_t {aka long unsigned int}' may alter
its value [-Wconversion]
In file included from /home/fred/lilypond/flower/test-string.cc:8:0:
/home/fred/lilypond/flower/include/yaffut.hh: In member function 'int
yaffut::Factory::Main(int, const char**)':
/home/fred/lilypond/flower/include/yaffut.hh:211:39: warning:
conversion to 'int' from 'size_t {aka long unsigned int}' may alter
its value [-Wconversion]
In file included from /home/fred/lilypond/flower/test-std.cc:13:0:
/home/fred/lilypond/flower/include/yaffut.hh: In member function 'int
yaffut::Factory::Main(int, const char**)':
/home/fred/lilypond/flower/include/yaffut.hh:211:39: warning:
conversion to 'int' from 'size_t {aka long unsigned int}' may alter
its value [-Wconversion]
/home/fred/lilypond/flower/include/yaffut.hh: In function 'int
main(int, const char**)':
/home/fred/lilypond/flower/include/yaffut.hh:401:34: error: 'getpid'
was not declared in this scope
In file included from /home/fred/lilypond/flower/test-file-path.cc:5:0:
/home/fred/lilypond/flower/include/yaffut.hh: In member function 'int
yaffut::Factory::Main(int, const char**)':
/home/fred/lilypond/flower/include/yaffut.hh:211:39: warning:
conversion to 'int' from 'size_t {aka long unsigned int}' may alter
its value [-Wconversion]
/home/fred/lilypond/flower/test-file-path.cc: In constructor
'{anonymous}::Find::Find()':
/home/fred/lilypond/flower/test-file-path.cc:13:29: error: 'getcwd'
was not declared in this scope
make[1]: *** [out/test-file-path.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [out/test-std.o] Error 1

Attachment: 0001-added-missing-inlude-unistd.h-for-use-with-g-4.7.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]