Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 413859

Summary: =dev-util/uncrustify-0.59 not compiles with gcc-4.7
Product: Gentoo Linux Reporter: David Kredba <kredba>
Component: [OLD] DevelopmentAssignee: Fabian Groffen <grobian>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 390247    

Description David Kredba 2012-04-28 11:58:36 UTC
indent.cpp: In function ‘void indent_text()’:
indent.cpp:405:43: warning: variable ‘was_preproc’ set but not used [-Wunused-but-set-variable]
uncrustify.cpp: In function ‘bool file_content_matches(const string&, const string&)’:
uncrustify.cpp:891:16: error: ‘close’ was not declared in this scope
uncrustify.cpp:899:45: error: ‘read’ was not declared in this scope
uncrustify.cpp:903:45: error: ‘read’ was not declared in this scope
uncrustify.cpp:918:13: error: ‘close’ was not declared in this scope
uncrustify.cpp: In function ‘void do_source_file(const char*, const char*, const char*, bool, bool)’:
uncrustify.cpp:1034:46: error: ‘unlink’ was not declared in this scope
align.cpp: In function ‘chunk_t* scan_ib_line(chunk_t*, bool)’:
align.cpp:1382:12: warning: variable ‘last_was_comment’ set but not used [-Wunused-but-set-variable]
align.cpp: In function ‘void align_typedefs(int)’:
align.cpp:1699:16: warning: variable ‘c_type’ set but not used [-Wunused-but-set-variable]
make[2]: *** [uncrustify-uncrustify.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/dev-util/uncrustify-0.59/work/uncrustify-0.59/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/portage/dev-util/uncrustify-0.59/work/uncrustify-0.59/src'
make: *** [all-recursive] Error 1
emake failed
Comment 1 Fabian Groffen gentoo-dev 2012-05-01 13:33:08 UTC
Does this patch help you to get further?

--- uncrustify-0.59/src/uncrustify.cpp.orig     2012-05-01 15:32:08.277426395 +0200
+++ uncrustify-0.59/src/uncrustify.cpp  2012-05-01 15:32:37.204372072 +0200
@@ -24,6 +24,9 @@
 #include <cstdlib>
 #include <cstring>
 #include <cerrno>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <fcntl.h>
 #include "unc_ctype.h"
 #ifdef HAVE_SYS_STAT_H
Comment 2 David Kredba 2012-05-06 10:59:42 UTC
Yes, it works perfectly with your patch.

Thank you very much.
Comment 3 Fabian Groffen gentoo-dev 2012-05-06 11:25:55 UTC
cool, committed, thanks for testing