Page 1 of 1

[DONE] name conflict in console.c

Posted: Wed Mar 12, 2014 9:16 am
by lilvinz
Hi,

i am getting the following name conflicts when building console.c on ubuntu LTS 32bit:

Code: Select all

ChibiOS//os/hal/platforms/Posix/console.c: In function ‘putt’:
ChibiOS//os/hal/platforms/Posix/console.c:77:50: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
ChibiOS//os/hal/platforms/Posix/console.c: In function ‘gett’:
ChibiOS//os/hal/platforms/Posix/console.c:86:39: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
ChibiOS//os/hal/platforms/Posix/console.c: In function ‘writet’:
ChibiOS//os/hal/platforms/Posix/console.c:93:71: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
ChibiOS//os/hal/platforms/Posix/console.c: In function ‘readt’:
ChibiOS//os/hal/platforms/Posix/console.c:103:64: error: declaration of ‘time’ shadows a global declaration [-Werror=shadow]
ChibiOS//os/kernel/src/chvt.c: In function ‘chVTSetI’:
ChibiOS//os/kernel/src/chvt.c:76:44: error: declaration of ‘time’ shadows a global declaration
ChibiOS//os/kernel/src/chschd.c: In function ‘chSchGoSleepTimeoutS’:
ChibiOS//os/kernel/src/chschd.c:189:57: error: declaration of ‘time’ shadows a global declaration
cc1: all warnings being treated as errors


Building on linux mint 15 amd64 doesn't produce this error.
It looks like libc is exporting "time" as a global symbol.

Cheers,

Vinz

Re: name conflict in console.c

Posted: Wed Mar 12, 2014 8:59 pm
by theShed
could you post the gcc version for the two systems?
> gcc --version

thanks
--
mike

Re: [TODO] name conflict in console.c

Posted: Wed Mar 12, 2014 9:02 pm
by Giovanni
Hi,

Forgot this thread... added it to the TODO list.

Giovanni

Re: [TODO] name conflict in console.c

Posted: Wed Mar 12, 2014 9:24 pm
by lilvinz
Please note that a lot more files are affected by this.
I added a patch which you may use as you see fit.

Re: [DONE] name conflict in console.c

Posted: Sun Mar 16, 2014 11:22 am
by Giovanni
Hi,

Sorry, not fixing this, I would have to change 2.4.x, 2.6.x, 3.0.0 and the trunk for a warning affecting just the simulator.

You may suppress that specific warning in the makefile when building the simulator. I may perform the changes in 3.0.0 only at a later time.

Giovanni