Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 79314 - emerging gnome-applets-1.4.0.5 failed: pasting "&" and "LoadGraph" does not give a valid preprocessing token
Summary: emerging gnome-applets-1.4.0.5 failed: pasting "&" and "LoadGraph" does not g...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Lowest normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-24 04:25 UTC by Selecter
Modified: 2006-02-18 19:48 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch to correct preprocessor macro. (main.patch,621 bytes, patch)
2005-05-19 11:35 UTC, Howard B. Golden
Details | Diff
Updated ebuild using the proposed patch. (gnome-applets-1.4.0.5.ebuild,1.10 KB, application/octet-stream)
2005-05-21 05:25 UTC, Martin Wegner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Selecter 2005-01-24 04:25:09 UTC
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -DGNOMELOCALEDIR=\""/usr/share/locale"\" -I -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/orbit-1.0 -I/usr/include/gtk-1.2 -I/usr/X11R6/include -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/orbit-1.0 -I/usr/include/gtk-1.2 -I/usr/X11R6/include -I/usr/include/libcapplet1 -I/usr/include/libgtop-1.0 -DHAVE_LIBGTOP_SMP -DHAVE_LIBGTOP_SYSINFO -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/orbit-1.0 -I/usr/include/gtk-1.2 -I/usr/X11R6/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include  -Os -march=i686 -fomit-frame-pointer -pipe -Wall -Wunused  -c properties.c
main.c:210:39: pasting "&" and "LoadGraph" does not give a valid preprocessing token
main.c:210:39: pasting "." and "cpuload" does not give a valid preprocessing token
main.c:210:39: pasting "cpuload" and ")" does not give a valid preprocessing token
main.c:211:39: pasting "&" and "LoadGraph" does not give a valid preprocessing token
main.c:211:39: pasting "." and "memload" does not give a valid preprocessing token
main.c:211:39: pasting "memload" and ")" does not give a valid preprocessing token
main.c:212:40: pasting "&" and "LoadGraph" does not give a valid preprocessing token
main.c:212:40: pasting "." and "swapload" does not give a valid preprocessing token
main.c:212:40: pasting "swapload" and ")" does not give a valid preprocessing token
main.c:213:39: pasting "&" and "LoadGraph" does not give a valid preprocessing token
main.c:213:39: pasting "." and "netload" does not give a valid preprocessing token
main.c:213:39: pasting "netload" and ")" does not give a valid preprocessing token
main.c:214:39: pasting "&" and "LoadGraph" does not give a valid preprocessing token
main.c:214:39: pasting "." and "loadavg" does not give a valid preprocessing token
main.c:214:39: pasting "loadavg" and ")" does not give a valid preprocessing token
make[3]: *** [main.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/var/tmp/portage/gnome-applets-1.4.0.5/work/gnome-applets-1.4.0.5/multiload'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/gnome-applets-1.4.0.5/work/gnome-applets-1.4.0.5/multiload'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gnome-applets-1.4.0.5/work/gnome-applets-1.4.0.5'
make: *** [all-recursive-am] Error 2

!!! ERROR: gnome-base/gnome-applets-1.4.0.5 failed.
!!! Function src_compile, Line 35, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




Portage 2.0.51-r14 (default-linux/x86/2004.3, gcc-3.3.5,
glibc-2.3.4.20041102-r0, 2.6.10-bk1y i686)
=================================================================
System uname: 2.6.10-bk1y i686 Intel(R) Pentium(R) 4 CPU 1.70GHz
Gentoo Base System version 1.6.8
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Jan 19 2005, 21:14:26)]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r2
sys-devel/libtool:   1.5.10-r3
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-Os -march=i686 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -march=i686 -fomit-frame-pointer -pipe -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig buildpkg distlocks sfperms"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/
ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo
ftp://ftp6.uni-muenster.de/pub/linux/distributions/gentoo
http://ftp.du.se/pub/os/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts avi crypt cups encode esd f77 foomaticdb fortran gdbm
gif gnome gpm gtk gtk2 guile imlib javascript jpeg libg++ libwww mad mikmod
motif mpeg ncurses nls nptl nptlonly oggvorbis opengl oss pam pdflib perl png
python qt quicktime readline sdl spell ssl svga tcpd tiff truetype
truetype-fonts userlocales xml xml2 xmms xv zlib linguas_ru"
Unset:  ASFLAGS, CBUILD, CTARGET, PORTDIR_OVERLAY
Comment 1 Selecter 2005-01-25 03:01:27 UTC
https://wwwlistbox.cern.ch/earchive/atlas-sw-bugs/msg01132.html

The ## preprocessor directive should only be used when catenating 
alphanumerical strings to create new tokens. Gcc 3.3 is more strict than gcc 
3.2 in the parsing of the code, and treats this violation of the grammar as 
an error. Gcc 3.2 let it slip through.

I could not emerge gcc 3.2 (using 3.3, 3.4) - so there is no temporary workaround for me. Sad... sad...
gcc -DIN_GCC    -O -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H    -I. -I. -I/var/tmp/portage/gcc-3.2.3-r4/work/gcc-3.2.3/gcc -I/var/tmp/portage/gcc-3.2.3-r4/work/gcc-3.2.3/gcc/. -I/var/tmp/portage/gcc-3.2.3-r4/work/gcc-3.2.3/gcc/config -I/var/tmp/portage/gcc-3.2.3-r4/work/gcc-3.2.3/gcc/../include \
       -c /var/tmp/portage/gcc-3.2.3-r4/work/gcc-3.2.3/gcc/c-parse.c -o c-parse.o
c-p8864.c:349:20: attempt to use poisoned "malloc"
c-p8864.c: In function `yy_stack_print':
c-p8864.c:2157: warning: traditional C rejects ISO C style function definitions
c-p8864.c: In function `yy_reduce_print':
c-p8864.c:2183: warning: traditional C rejects ISO C style function definitions
c-p8864.c: In function `yysymprint':
c-p8864.c:2299: warning: traditional C rejects ISO C style function definitions
c-p8864.c: In function `yydestruct':
c-p8864.c:2336: warning: traditional C rejects ISO C style function definitions
c-p8864.c: In function `yyparse_1':
c-p8864.c:2403: warning: traditional C rejects ISO C style function definitions
make[2]: *** [c-parse.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/gcc-3.2.3-r4/work/build/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/var/tmp/portage/gcc-3.2.3-r4/work/build/gcc'
make: *** [bootstrap-lean] Error 2
Comment 2 Howard B. Golden 2005-05-19 11:35:17 UTC
Created attachment 59314 [details, diff]
Proposed patch to correct preprocessor macro.

I removed what appeared to be unnecessary ## concatenators. After this change,
it works for me.
Comment 3 foser (RETIRED) gentoo-dev 2005-05-20 08:37:15 UTC
shouldn't it become the following then to keep the intended functionality ? I'm
not very familiar with this directive.

#define ADD_PROPERTIES(x,y) multiload_property_object_list = g_list_append
(multiload_property_object_list, gnome_property_object_new (&  x ##
Property_Descriptor, & multiload_properties. ## y ))
Comment 4 Martin Wegner 2005-05-21 05:25:33 UTC
Created attachment 59450 [details]
Updated ebuild using the proposed patch.

Updated ebuild using the proposed patch. Works for me.
Comment 5 Jason Wever (RETIRED) gentoo-dev 2005-05-21 15:10:15 UTC
Patch and updated ebuild work on SPARC.
Comment 6 Guy Martin (RETIRED) gentoo-dev 2005-05-25 05:36:08 UTC
Can this be fixed please ? It needs to be marked stable in order to be able to
mark stable the latest gtk-perl which depends on it.

Thanks
Comment 7 foser (RETIRED) gentoo-dev 2005-05-25 07:03:13 UTC
I'd really like to see my suggestion in comment #3 tested, it seems closer to
the original code.
Comment 8 Howard B. Golden 2005-05-25 08:19:36 UTC
Re: Comment #3 and comment #7:

foser, as I read the documentation of the ## concatenator, your suggestion is
syntactically invalid because it would create a token consisting of "."
concatenated with the y argument. The problem is that "." is ALREADY a token and
the concatenated expression isn't.

Please notice the original bug report where the compiler complained about such a
concatenation:

   main.c:213:39: pasting "." and "netload" does not give a valid preprocessing
token

I believe that the patch I submitted is correct as is.

Howard
Comment 9 foser (RETIRED) gentoo-dev 2005-05-25 16:35:11 UTC
I read the doc, but that is what it seems to do, legal or not. The question was
if it compiles/works or not.
Comment 10 Howard B. Golden 2005-05-25 18:07:16 UTC
Re: Comment #9:

foser, are you from Missouri? (The "show me" state for non-US readers.) ;-)

Here are the results I got using your proposed definition:

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I.
-DGNOMELOCALEDIR=\""/usr/share/locale"\" -I -I/usr/include/gnome-1.0
-DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/glib-1.2
-I/usr/lib/glib/include -I/usr/include/orbit-1.0 -I/usr/include/gtk-1.2
-I/usr/X11R6/include -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
-I/usr/lib/gnome-libs/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include
-I/usr/include/orbit-1.0 -I/usr/include/gtk-1.2 -I/usr/X11R6/include
-I/usr/include/libcapplet1 -I/usr/include/libgtop-1.0 -DHAVE_LIBGTOP_SMP
-DHAVE_LIBGTOP_SYSINFO -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H
-I/usr/lib/gnome-libs/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include
-I/usr/include/orbit-1.0 -I/usr/include/gtk-1.2 -I/usr/X11R6/include
-I/usr/include/glib-1.2 -I/usr/lib/glib/include  -I/usr/include/gtk-1.2
-I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include 
-march=athlon-xp -O2 -pipe -fstack-protector -Wall -Wunused  -c main.c
main.c:210:1: pasting "." and "cpuload" does not give a valid preprocessing token
main.c:211:1: pasting "." and "memload" does not give a valid preprocessing token
main.c:212:1: pasting "." and "swapload" does not give a valid preprocessing token
main.c:213:1: pasting "." and "netload" does not give a valid preprocessing token
main.c:214:1: pasting "." and "loadavg" does not give a valid preprocessing token
make: *** [main.o] Error 1

This is with gcc (GCC) 3.4.3-20050110 (Gentoo Linux 3.4.3.20050110-r2,
ssp-3.4.3.20050110-0, pie-8.7.7).

To reiterate Selecter's comment #1:

"The ## preprocessor directive should only be used when catenating 
alphanumerical strings to create new tokens. Gcc 3.3 is more strict than gcc 
3.2 in the parsing of the code, and treats this violation of the grammar as 
an error. Gcc 3.2 let it slip through."

In other words, you could write x ## Property_Descriptor, which will concatenate
the value of the x argument with the string "Property_Descriptor" returning a
single string token. However, "." is a token already, so you can't concatenate
it with any string, since this would give you TWO tokens, not one. Apparently,
earlier GCC's let you do this, but it's not how the ## operator is defined, and
they have made the compiler catch these errors in gcc-3.4 (and maybe gcc-3.3).

Howard
Comment 11 foser (RETIRED) gentoo-dev 2005-05-27 02:25:37 UTC
Yes I asked you to show me. I don't know what older gcc's produced for code, but
apparently they did let this trough and if it does the way i think it does, this
patch changes the functionality of the bit with undefined consequences. That is
what I'm worried about, not if it 'compiles or not'.
Comment 12 Howard B. Golden 2005-05-27 10:08:29 UTC
Re: Comment #11: foser, I understand your concern. However, I don't have the
time or facilities to test it as thoroughly as you are looking for.

Perhaps another approach is to refer the bug upstream? However, in looking at
the codebase on the Gnome CVS, I see that the code changed greatly after
gnome-1.4, so I wonder if anyone still cares about gnome-1.4 bugs?

Please let me know if you want me to try anything specific. Otherwise, I'll just
leave this as a "proposed patch" that you will do what you wish with. It works
for me.

Howard
Comment 13 foser (RETIRED) gentoo-dev 2005-05-27 10:24:54 UTC
gnome 1.4 is unmaintained upstream.
Comment 14 John N. Laliberte (RETIRED) gentoo-dev 2005-09-18 19:16:32 UTC
are you still having this problem?
Comment 15 Martin Wegner 2005-09-22 12:39:34 UTC
In the meantime 1.4.0.5 is no longer installed here, but 2.10.1
Comment 16 John N. Laliberte (RETIRED) gentoo-dev 2006-02-18 19:48:37 UTC
no response from reporter