Skip to contentSkip to conversation

Include common.h in qsort.c to fix build warning

PATCH New Simon Glass 4 participants 7 messages Dec 6, 2011 – Dec 7, 2011 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Include common.h in qsort.c to fix build warning

exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:

qsort.c: In function 'qsort':
qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]

---
 lib/qsort.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
lib/qsort.c +1 -0
index 86c392c..5709884 100644
@@ -16,6 +16,7 @@
  * bcc and gcc. */
 
 #include <linux/types.h>
+#include <common.h>
 #include <exports.h>
 
 void qsort(void  *base,
Signature · 1 line
1.7.3.1
#1 lore raw

PATCH 2/2 Fix unused function in cmd_bdinfo.c

It is fine to use __maybe_unused instead of #ifdef, but we also need one for print_eth() since not all boards have Ethernet. This fixes this warning:

cmd_bdinfo.c:39:13: warning: 'print_eth' defined but not used [-Wunused-function]

---
 common/cmd_bdinfo.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
common/cmd_bdinfo.c +1 -0
index 73c03a8..67cb0da 100644
@@ -36,6 +36,7 @@ static void print_num(const char *name, ulong value)
 	printf("%-12s= 0x%08lX\n", name, value);
 }
 
+__maybe_unused
 static void print_eth(int idx)
 {
 	char name[10], *val;
Signature · 1 line
1.7.3.1
#2 lore raw

PATCH 2/2 Fix unused function in cmd_bdinfo.c

Dear Simon Glass,

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

It is fine to use __maybe_unused instead of #ifdef, but we also need one for print_eth() since not all boards have Ethernet. This fixes this warning:

cmd_bdinfo.c:39:13: warning: 'print_eth' defined but not used [-Wunused-function]

---
 common/cmd_bdinfo.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 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
If I had to live my life again,  I'd  make  the  same  mistakes, only
sooner.                                          -- Tallulah Bankhead
#3 lore raw

PATCH 1/2 Include common.h in qsort.c to fix build warning

In reply to Simon Glass
Quoted 10 lines · Simon Glass

exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:

qsort.c: In function 'qsort':
qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]

---
lib/qsort.c | 1 +

1 files changed, 1 insertions(+), 0 deletions(-)

---

w/o this we actually have compile failure with the tree:

In file included from qsort.c:19:0:
/local/home/galak/git/u-boot/include/exports.h:19:27: error: expected declaration specifiers or '...' before 'va_list' qsort.c: In function 'qsort':
qsort.c:30:3: warning: implicit declaration of function 'assert'

- k

#4 lore raw

PATCH 1/2 Include common.h in qsort.c to fix build warning

Hi Kumar,

Quoted 16 lines · Kumar Gala
Quoted 10 lines · Simon Glass

exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:

qsort.c: In function 'qsort':
qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]

---
lib/qsort.c | ? ?1 +

1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 9 lines

---

w/o this we actually have compile failure with the tree:

In file included from qsort.c:19:0:
/local/home/galak/git/u-boot/include/exports.h:19:27: error: expected declaration specifiers or '...' before 'va_list' qsort.c: In function 'qsort':
qsort.c:30:3: warning: implicit declaration of function 'assert'

Yes I was trying to be polite :-)

Regards,
Simon

Quoted 2 lines

- k

#5 lore raw

PATCH 1/2 Include common.h in qsort.c to fix build warning

In reply to Simon Glass

Hello Simon,

Quoted 7 lines · Simon Glass

exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:

qsort.c: In function 'qsort':
qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]

Tested on the cam_enc_4xx board:

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#6 lore raw

PATCH 1/2 Include common.h in qsort.c to fix build warning

In reply to Simon Glass

Dear Simon Glass,

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

exports.h no longer includes common.h, which contains assert(). qsort.c needs to be updated. This fixes this warning:

qsort.c: In function 'qsort':
qsort.c:30:3: warning: implicit declaration of function 'assert' [-Wimplicit-function-declaration]

---
 lib/qsort.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 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
"Language shapes the way we think, and determines what we  can  think
about."                                                 - B. L. Whorf