Gentoo Archives: gentoo-user

From: Michael Schreckenbauer <grimlog@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Plasma-runtime compilation problems
Date: Thu, 11 Aug 2011 08:33:29
Message-Id: 2380316.dSHcnf9Jls@pc
In Reply to: [gentoo-user] Re: Plasma-runtime compilation problems by walt
1 Hi Walt,
2
3 Am Mittwoch, 10. August 2011, 16:16:50 schrieb walt:
4 > On 08/10/2011 03:04 PM, Michael Schreckenbauer wrote:
5 > > Hi,
6 > >
7 > > Am Mittwoch, 10. August 2011, 14:40:31 schrieb walt:
8 > >> On 08/09/2011 08:34 PM, Jeff Cranmer wrote:
9 > >>> Hi all,
10 > >>>
11 > >>> I'm trying to upgrade kde from 4.4 to 4.6, and I've run into a
12 > >>> problem.
13 > >>>
14 > >>> Plasma-runtime-4.6.3 is failing. The error appears to be
15 > >>> redefinition of 'struct QMetaTypeID<Plasma::Service*>'
16 > >>
17 > >> I don't use kde so I can't be specific, but usually a redefinition is
18 > >> just a warning -- unless the package is compiled with the -Wall flag
19 > >> or
20 > >> equivalent.
21 >
22 > (Of course I meant -Werror, sorry.)
23
24 no prob.
25
26 > > No, this is plain wrong. Redefinition of a struct is an error in C and
27 > > C++
28 > >
29 > > ~$cat foo.c
30 > > struct foo {
31 > >
32 > > int i;
33 > >
34 > > };
35 > >
36 > > struct foo {
37 > >
38 > > char* v;
39 > >
40 > > };
41 > >
42 > > ~$gcc foo.c -o foo
43 > > foo.c:5:8: error: redefinition of 'struct foo'
44 > > foo.c:1:8: note: originally defined here
45 >
46 > Hm. I know I've seen compiler redefinition messages thousands of times
47 > over the years. Is it really possible that all of those thousands were
48 > errors instead of warnings? If that's true then I've wasted a lot more
49 > time tracking them down than I care to think about :)
50
51 struct redefinition is always an error.
52 Maybe what you saw as a warning was some kind of macro redefined.
53
54 ~ $ cat bar.c
55 #define BAR 0
56 #define BAR 1
57
58 int main()
59 {
60 }
61
62 ~$gcc bar.c -o bar
63 bar.c:2:0: warning: "BAR" redefined
64 bar.c:1:0: note: this is the location of the previous definition
65
66 Note the different wording in the message.
67
68 Regards,
69 Michael

Replies

Subject Author
[gentoo-user] Re: Plasma-runtime compilation problems walt <w41ter@×××××.com>