Subject: 24.2.50; clang cannot compile src/xterm.c on Mac OS X 10.6.8
From: Peter Dyballa <[email-masked]>
To: [email-masked]
Date: Sun, 2 Sep 2012 13:08:26 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello!

Having configured as

In GNU Emacs 24.2.50.1 (i386-apple-darwin10.8.0, X toolkit, Xaw3d scroll bars)
of 2012-09-02 on Sumac.local
Bzr revision: 109853 [email-masked]
Configured using:
`configure '--build=x86_64-apple-darwin10.8.0'
'--host=i386-apple-darwin10.8.0' '--target=i386-apple-darwin10.8.0'
'--with-wide-int' '--without-pop' '--without-sound' '--without-gpm'
'--without-dbus' '--without-selinux' '--with-x-toolkit=athena'
'--disable-ns-self-contained' '--without-xpm' '--without-jpeg'
'--without-tiff' '--without-gif' '--without-png' '--without-rsvg'
'--x-libraries=/usr/X11/lib' '--x-includes=/usr/X11/include'
'--enable-locallisppath=/Library/Application
Support/Emacs/calendar24:/Library/Application Support/Emacs' 'CFLAGS=-g
-H -pipe -fPIC -fno-common -O0 -march=prescott -mtune=prescott -m32
-fomit-frame-pointer -msse3 -foptimize-register-move -ftree-vectorize'
'CPPFLAGS=-I/sw/include' 'LDFLAGS=-L/sw/lib -m32 -Wl,-dead_strip_dylibs
-Wl,-bind_at_load -Wl,-t' 'CC=clang' 'CXX=clang++'
'PKG_CONFIG_PATH=/sw/lib/xft2/lib/pkgconfig:/sw/share/pkgconfig:/sw/lib/pkgconfig:/usr/X11/lib\
/pkgconfig:/usr/X11/share/pkgconfig:/usr/lib/pkgconfig'
'build_alias=x86_64-apple-darwin10.8.0'
'host_alias=i386-apple-darwin10.8.0'
'target_alias=i386-apple-darwin10.8.0''

the make process ends with:

	clang -c -I/sw/include -Demacs  -I. -I.../emacs-24.2.50/src -I../lib -I.../emacs-24.2.50/src/../lib   -I/usr/X11/include -I/sw/include -I/sw/include/freetype2 -I/usr/X11/include -I/usr/X11R6/include    -I/sw/include/ImageMagick -fopenmp -I/sw/include/libxml2 -I/sw/include   -I/sw/include/freetype2 -I/sw/include -I/sw/include   -I/sw/include/freetype2 -I/sw/include -I/sw/include   -MMD -MF deps/xterm.d -MP  -I/sw/include     -g -H -pipe -fPIC -fno-common -O0 -march=prescott -mtune=prescott -m32 -fomit-frame-pointer -msse3 -foptimize-register-move -ftree-vectorize xterm.c
	clang: warning: argument unused during compilation: '-fopenmp'
	clang: warning: argument unused during compilation: '-foptimize-register-move'
	clang: warning: argument unused during compilation: '-ftree-vectorize'
	In file included from xterm.c:30:
	./lisp.h:2961:39: warning: unknown attribute 'externally_visible' ignored [-Wunknown-attributes]
	extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
	                                      ^
	In file included from xterm.c:23:
	In file included from ./config.h:1702:
	./conf_post.h:193:43: note: instantiated from:
	#define EXTERNALLY_VISIBLE __attribute__((externally_visible))
	                                          ^
	xterm.c:8316:3: warning: implicit declaration of function 'x_wm_set_size_hint' is invalid in C99
	      [-Wimplicit-function-declaration]
	  x_wm_set_size_hint (f, (long) 0, 0);
	  ^
	xterm.c:8577:15: warning: enumeration value 'FULLSCREEN_WAIT' not handled in switch [-Wswitch-enum]
	      switch (f->want_fullscreen)
	              ^
	xterm.c:8687:15: warning: enumeration values 'FULLSCREEN_NONE' and 'FULLSCREEN_WAIT' not handled in
	      switch [-Wswitch-enum]
	      switch (f->want_fullscreen)
	              ^
	xterm.c:9258:2: warning: expression result unused [-Wunused-value]
	        FRAME_SAMPLE_VISIBILITY (f);
	        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
	In file included from xterm.c:62:
	./frame.h:922:29: note: instantiated from:
	   SET_FRAME_GARBAGED (f) : 0, \
	                            ^
	xterm.c:9355:3: warning: expression result unused [-Wunused-value]
	  FRAME_SAMPLE_VISIBILITY (f);
	  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
	In file included from xterm.c:62:
	./frame.h:922:29: note: instantiated from:
	   SET_FRAME_GARBAGED (f) : 0, \
	                            ^
	xterm.c:9610:1: error: conflicting types for 'x_wm_set_size_hint'
	x_wm_set_size_hint (struct frame *f, long flags, int user_position)
	^
	xterm.c:8316:3: note: previous implicit declaration is here
	  x_wm_set_size_hint (f, (long) 0, 0);
	  ^
	6 warnings and 1 error generated.
	make[1]: *** [xterm.o] Error 1

Making clang produce only pre-compiled output (with -E -dD) I cannot see a declaration. For use with GTK there seems to exist one in src/gtkutil.h, line #153:

	extern void x_wm_set_size_hint (FRAME_PTR f,
	                                long flags,
	                                int user_position);

--
Greetings

  Pete

The light at the end of the tunnel has been turned off due to budget cuts.