Bug 280380 - Missing #include <unistd.h>'s
Summary: Missing #include <unistd.h>'s
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 4.2.3
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-18 21:22 UTC by David
Modified: 2012-01-26 21:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David 2011-08-18 21:22:53 UTC
Version:           unspecified (using Devel) 
OS:                Linux

#include <unistd.h> is missing in two places:

kdevplatform/util/dbus_socket_transformer/main.cpp:64:22: error: ‘getuid’ was not declared in this scope

kdevelop/debuggers/gdb/unittests/debugeethreads.cpp:38:18: error: ‘usleep’ was not declared in this scope

Simply adding:

#include <unistd.h>

to the top of the two files in those errors fixes the compiler errors.

Reproducible: Didn't try

Steps to Reproduce:
Try to build.


Expected Results:  
Build error free.
Comment 1 John 2012-01-24 17:12:03 UTC
This problem is also present in 4.2.81 at least in the second case above (not got as far as searching for others.

gcc used to include unistd.h in <iostream>, <string> and other STL headers in order to implement said headers. This was however non-standard and the offending includes have been removed starting with gcc 4.7. As a result this is a fairly important thing to fix as gcc 4.7 and beyond become the norm.
Comment 2 Milian Wolff 2012-01-26 20:54:09 UTC
Git commit a5c0b91af133f22016adf4711e6b921d16b18a23 by Milian Wolff.
Committed on 26/01/2012 at 21:51.
Pushed by mwolff into branch '1.3'.

add include of unistd.h for GCC 4.7 and above

M  +1    -0    util/dbus_socket_transformer/main.cpp

http://commits.kde.org/kdevplatform/a5c0b91af133f22016adf4711e6b921d16b18a23
Comment 3 Milian Wolff 2012-01-26 21:05:55 UTC
Git commit 456b2f8247f88f76f028a2398b72946724cc56ee by Milian Wolff.
Committed on 26/01/2012 at 21:53.
Pushed by mwolff into branch '4.3'.

add include of unistd.h for compatibility with GCC 4.7

M  +1    -0    debuggers/gdb/unittests/debugeethreads.cpp

http://commits.kde.org/kdevelop/456b2f8247f88f76f028a2398b72946724cc56ee