Skip to contentSkip to conversation

davinci_emac.c:*: warning: duplicate `volatile'

U-Boot Wolfgang Denk 2 participants 6 messages Aug 15, 2009 – Aug 17, 2009

lore
Share & tools
lore
#0 lore raw

Dear Sergey,

in include/asm-arm/arch-davinci/emac_defs.h you declare emac_desc with the "volatile" attribute, but when using it, "volatile" is frequently added again, resulting in complier warnings like these:

Configuring for davinci_sffsdr board... davinci_emac.c:82: warning: duplicate volatile' davinci_emac.c:83: warning: duplicate volatile' davinci_emac.c:84: warning: duplicate volatile' davinci_emac.c:85: warning: duplicate volatile' davinci_emac.c: In function `davinci_eth_open':
davinci_emac.c:257: warning: duplicate volatile' davinci_emac.c: In function davinci_eth_rcv_packet':
davinci_emac.c:475: warning: duplicate volatile' davinci_emac.c:476: warning: duplicate volatile' davinci_emac.c:477: warning: duplicate volatile' davinci_emac.c:496: warning: duplicate volatile'

Can you please provide a fix? Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Drawing on my fine command of language, I said nothing.
#1 lore raw

On Sun, 16 Aug 2009, Wolfgang Denk wrote:

OK, I'll try to fix it tomorrow or Monday, very busy right now...

Quoted 20 lines

Dear Sergey,

in include/asm-arm/arch-davinci/emac_defs.h you declare emac_desc with the "volatile" attribute, but when using it, "volatile" is frequently added again, resulting in complier warnings like these:

Configuring for davinci_sffsdr board... davinci_emac.c:82: warning: duplicate volatile' davinci_emac.c:83: warning: duplicate volatile' davinci_emac.c:84: warning: duplicate volatile' davinci_emac.c:85: warning: duplicate volatile' davinci_emac.c: In function `davinci_eth_open':
davinci_emac.c:257: warning: duplicate volatile' davinci_emac.c: In function davinci_eth_rcv_packet':
davinci_emac.c:475: warning: duplicate volatile' davinci_emac.c:476: warning: duplicate volatile' davinci_emac.c:477: warning: duplicate volatile' davinci_emac.c:496: warning: duplicate volatile'

Quoted 12 lines

Can you please provide a fix? Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Drawing on my fine command of language, I said nothing.

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

#2 lore raw
In reply to Wolfgang Denk
Quoted 20 lines · Wolfgang Denk

Dear Sergey,

in include/asm-arm/arch-davinci/emac_defs.h you declare emac_desc with the "volatile" attribute, but when using it, "volatile" is frequently added again, resulting in complier warnings like these:

Configuring for davinci_sffsdr board... davinci_emac.c:82: warning: duplicate volatile' davinci_emac.c:83: warning: duplicate volatile' davinci_emac.c:84: warning: duplicate volatile' davinci_emac.c:85: warning: duplicate volatile' davinci_emac.c: In function `davinci_eth_open':
davinci_emac.c:257: warning: duplicate volatile' davinci_emac.c: In function davinci_eth_rcv_packet':
davinci_emac.c:475: warning: duplicate volatile' davinci_emac.c:476: warning: duplicate volatile' davinci_emac.c:477: warning: duplicate volatile' davinci_emac.c:496: warning: duplicate volatile'

Quoted 1 line

Can you please provide a fix? Thanks in advance.

Hey,

what compiler do you use? I just compiled all the davinci boards with GNUEABI GCC 4.4.1 (binutils ver.2.19.1) and I didn't get a single compiler warning.

There are 2 separate issues but they are not related to the above description.

First is that it fails to compile with GNUEABI GCC but that is addressed in your recent arm build patch that works OK.

The second one is that GCC 4.4.1 (don't know about the older ones, don't have those on my machine now) generates an error for inline weak functions in lib_arm/board.c (and I think it is totally correct -- what is an inline weak function?) Here is the failed build log excertpt:

=== Cut ===
board.c:127: error: inline function 'coloured_LED_init' cannot be declared weak
board.c:129: error: inline function 'red_LED_on' cannot be declared weak board.c:131: error: inline function 'red_LED_off' cannot be declared weak board.c:133: error: inline function 'green_LED_on' cannot be declared weak board.c:135: error: inline function 'green_LED_off' cannot be declared weak board.c:137: error: inline function 'yellow_LED_on' cannot be declared weak board.c:139: error: inline function 'yellow_LED_off' cannot be declared weak board.c:141: error: inline function 'blue_LED_on' cannot be declared weak board.c:143: error: inline function 'blue_LED_off' cannot be declared weak make[1]: *** [board.o] Error 1
make[1]: Leaving directory /usr/src/U-Boot/Davinci/u-boot/lib_arm'
make: *** [lib_arm/libarm.a] Error 2
=== Cut ===

Do you want me to send a fix for those? It hardly makes sense, you can do it yourself by removing "inline" qualifier at those 9 lines but I can send a patch if you want me to.

As for those "duplicate `volatile'" warnings I don't see them (and have never seen them before) so I don't know what to fix.

I can send you my build logs off the list if you want.

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

#3 lore raw

Dear ksi at koi8.net,

Quoted 4 lines · In message <[email protected]> you wrote:

what compiler do you use? I just compiled all the davinci boards with GNUEABI GCC 4.4.1 (binutils ver.2.19.1) and I didn't get a single compiler warning.

I was playing with old tool chains actually. That was with gcc 3.3.x.

Quoted 5 lines

There are 2 separate issues but they are not related to the above description.

First is that it fails to compile with GNUEABI GCC but that is addressed in your recent arm build patch that works OK.

Thanks for the confirmation! Much appreciated. Could you please send an Ack-by or Tested-by for that patch? Thanks in advance.

Quoted 4 lines

The second one is that GCC 4.4.1 (don't know about the older ones, don't have those on my machine now) generates an error for inline weak functions in lib_arm/board.c (and I think it is totally correct -- what is an inline weak function?) Here is the failed build log excertpt:

A patch for this has been posted some time ago. See
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/65397/focus=65559

we're just waiting for the ARM custodian to take appropriate action.

Quoted 4 lines

As for those "duplicate `volatile'" warnings I don't see them (and have never seen them before) so I don't know what to fix.

I can send you my build logs off the list if you want.

Well, here is an example - building davinci_schmoogie using ELDK 3.1.1 (gcc version 3.3.3):

davinci_emac.c:82: warning: duplicate volatile' davinci_emac.c:83: warning: duplicate volatile' davinci_emac.c:84: warning: duplicate volatile' davinci_emac.c:85: warning: duplicate volatile' davinci_emac.c: In function `davinci_eth_open':
davinci_emac.c:257: warning: duplicate volatile' davinci_emac.c: In function davinci_eth_rcv_packet':
davinci_emac.c:475: warning: duplicate volatile' davinci_emac.c:476: warning: duplicate volatile' davinci_emac.c:477: warning: duplicate volatile' davinci_emac.c:496: warning: duplicate volatile'

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Our business is run on trust.  We trust you will pay in advance.
#4 lore raw
Quoted 9 lines · Wolfgang Denk

Dear ksi at koi8.net,

Quoted 4 lines · In message <[email protected]> you wrote:

what compiler do you use? I just compiled all the davinci boards with GNUEABI GCC 4.4.1 (binutils ver.2.19.1) and I didn't get a single compiler warning.

I was playing with old tool chains actually. That was with gcc 3.3.x.

Ah, that's ancient... I don't think we need to something for this. I betcha it won't compile at all with something like 2.x.x but who cares? :)

Quoted 8 lines
Quoted 5 lines

There are 2 separate issues but they are not related to the above description.

First is that it fails to compile with GNUEABI GCC but that is addressed in your recent arm build patch that works OK.

Thanks for the confirmation! Much appreciated. Could you please send an Ack-by or Tested-by for that patch? Thanks in advance.

Sure I will.

Quoted 9 lines
Quoted 4 lines

The second one is that GCC 4.4.1 (don't know about the older ones, don't have those on my machine now) generates an error for inline weak functions in lib_arm/board.c (and I think it is totally correct -- what is an inline weak function?) Here is the failed build log excertpt:

A patch for this has been posted some time ago. See
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/65397/focus=65559

we're just waiting for the ARM custodian to take appropriate action.

OK.

Quoted 8 lines
Quoted 4 lines

As for those "duplicate `volatile'" warnings I don't see them (and have never seen them before) so I don't know what to fix.

I can send you my build logs off the list if you want.

Well, here is an example - building davinci_schmoogie using ELDK 3.1.1 (gcc version 3.3.3):

Quoted 11 lines

davinci_emac.c:82: warning: duplicate volatile' davinci_emac.c:83: warning: duplicate volatile' davinci_emac.c:84: warning: duplicate volatile' davinci_emac.c:85: warning: duplicate volatile' davinci_emac.c: In function `davinci_eth_open':
davinci_emac.c:257: warning: duplicate volatile' davinci_emac.c: In function davinci_eth_rcv_packet':
davinci_emac.c:475: warning: duplicate volatile' davinci_emac.c:476: warning: duplicate volatile' davinci_emac.c:477: warning: duplicate volatile' davinci_emac.c:496: warning: duplicate volatile'

Once again -- I don't think it requires any action. It builds without a single warning with newer compilers, even with 4.2.x less for 4.4.1...

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

#5 lore raw

Dear ksi at koi8.net,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 2 lines

I was playing with old tool chains actually. That was with gcc 3.3.x.

Ah, that's ancient... I don't think we need to something for this. I betcha it won't compile at all with something like 2.x.x but who cares? :)

Indeed gcc 2.95 dies with a "unrecognized option `-MQ'" error message when attempting to generate the dependencies...

Quoted 4 lines
Quoted 2 lines

Thanks for the confirmation! Much appreciated. Could you please send an Ack-by or Tested-by for that patch? Thanks in advance.

Sure I will.

Thanks a lot.

...

Quoted 4 lines
Quoted 1 line

davinci_emac.c:496: warning: duplicate `volatile'

Once again -- I don't think it requires any action. It builds without a single warning with newer compilers, even with 4.2.x less for 4.4.1...

Yes, I know. But I still would like to hush up this gcc 3.x warning, if possible.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can observe a lot just by watching.                  - Yogi Berra