This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: actual errors from demo-sh3.sh build


----Original Message----
>From: Robert P. J. Day
>Sent: 06 September 2005 14:47

>   i'm about to crank up the sh3 dat file to pull in the latest of gcc,
> glibc, etc.  but here's the actual error from the current attempt to
> build for SH3 straight out of the demo-sh3.sh file:

>   HOSTCC  scripts/kconfig/mconf.o
> scripts/kconfig/mconf.c:91: error: static declaration of
> â??current_menuâ?? follows non-static declaration
> scripts/kconfig/lkc.h:63: error: previous declaration of
> â??current_menuâ?? was here
> make[1]: *** [scripts/kconfig/mconf.o] Error 1
> make: *** [oldconfig] Error 2

  Perfect!  Now that's more like it!

-------------------------------------------
dk@mace /repository/armtools/linux/scripts/kconfig> cat mconf.c | head -91 |
ta
il -4
static int indent;
static struct termios ios_org;
static int rows, cols;
static struct menu *current_menu;
dk@mace /repository/armtools/linux/scripts/kconfig> cat lkc.h | head -63 |
tail
 -4
int file_write_dep(const char *name);

extern struct menu *current_entry;
extern struct menu *current_menu;
dk@mace /repository/armtools/linux/scripts/kconfig>
-------------------------------------------

  OK, this is a real bug in the source, and the new compiler has stricter
error detection, so it's started to trip it.

  The problem is that there are two files in kconfig that each have their
own variable called 'current_menu':

lkc.h:extern struct menu *current_menu;
mconf.c:static struct menu *current_menu;
menu.c:struct menu *current_menu, *current_entry;

  So lkc.h is declaring the one from menu.c so that other modules can
reference it.  Mconf.c has its own variable with the same name, which it
doesn't wish to make externally visible.  When mconf.c #includes lkc.h, it
gets a namespace clash against the declaration of the menu.c one, even
though mconf.o isn't going to be linked against menu.o in the long run.

  You may be able to remove #include lkc.h from mconf.c, but that might
leave it failing to find declarations of other things.  The most correct
solution would be to either extract the declaration from lkc.h into a
separate file, such as menu.h, that could be included by all the other .c
files in the kconfig scripts dir, or to rename the 'current_menu' in mconf.c
(including all references to it) to some new name that doesn't clash with
the existing declaration.  Or it might just work to remove the 'static'
prefix from the declaration in menu.c; try it and see.



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]