Skip to contentSkip to conversation

getline prototype issue

U-Boot York Sun 2 participants 5 messages Jul 30, 2013

lore
Share & tools
lore

York Sun

author
#0 lore raw

Simon,

Your patch

commit 669dfc2ed8d853d6bcdcafa1de6aca22929465e5

Author: Simon Glass <[email protected]>
Date:   Mon Mar 11 06:30:27 2013 +0000

fdt: Ensure that libfdt_env.h comes from U-Boot

adds libfdt_env.h to HOSTCPPFLAGS. The causes a problem with one of our older hosts. On the old hosts, getline prototype is protected by

#ifdef __USE_GNU

This should be OK if the C file has #define _GNU_SOURCE. However, because of your patch, the stdio.h is included before _GNU_SOURCE is defined. The result is warnings like this

aisimage.c: In function ?aisimage_generate?:
aisimage.c:313: warning: implicit declaration of function ?getline? kwbimage.c: In function ?kwdimage_set_ext_header?:
kwbimage.c:236: warning: implicit declaration of function ?getline? imximage.c: In function ?parse_cfg_file?:
imximage.c:430: warning: implicit declaration of function ?getline? pblimage.c: In function ?pbl_parser?:
pblimage.c:137: warning: implicit declaration of function ?getline? ublimage.c: In function ?parse_cfg_file?:
ublimage.c:179: warning: implicit declaration of function ?getline?

York

#1 lore raw

Hi York,

Quoted 19 lines · York Sun

Simon,

Your patch

commit 669dfc2ed8d853d6bcdcafa1de6aca22929465e5

Author: Simon Glass <[email protected]>
Date:   Mon Mar 11 06:30:27 2013 +0000

fdt: Ensure that libfdt_env.h comes from U-Boot

adds libfdt_env.h to HOSTCPPFLAGS. The causes a problem with one of our older hosts. On the old hosts, getline prototype is protected by

#ifdef __USE_GNU

This should be OK if the C file has #define _GNU_SOURCE. However, because of your patch, the stdio.h is included before _GNU_SOURCE is defined. The result is warnings like this

Quoted 11 lines

aisimage.c: In function ?aisimage_generate?:
aisimage.c:313: warning: implicit declaration of function ?getline? kwbimage.c: In function ?kwdimage_set_ext_header?:
kwbimage.c:236: warning: implicit declaration of function ?getline? imximage.c: In function ?parse_cfg_file?:
imximage.c:430: warning: implicit declaration of function ?getline? pblimage.c: In function ?pbl_parser?:
pblimage.c:137: warning: implicit declaration of function ?getline? ublimage.c: In function ?parse_cfg_file?:
ublimage.c:179: warning: implicit declaration of function ?getline?

I took a quick look at this. It seems that many of the host C files in tools/ define _GNU_SOURCE. Should we just move that #define to the Makefile?

Regards,
Simon

Quoted 4 lines

York

author
#2 lore raw
Quoted 36 lines · Simon Glass

Hi York,

On Tue, Jul 30, 2013 at 3:12 PM, York Sun <[email protected] <mailto:[email protected]>> wrote:

Simon,

Your patch

commit 669dfc2ed8d853d6bcdcafa1de6aca22929465e5
Author: Simon Glass <sjg at chromium.org <mailto:[email protected]>>
Date: Mon Mar 11 06:30:27 2013 +0000

fdt: Ensure that libfdt_env.h comes from U-Boot

adds libfdt_env.h to HOSTCPPFLAGS. The causes a problem with one of our older hosts. On the old hosts, getline prototype is protected by

#ifdef __USE_GNU

This should be OK if the C file has #define _GNU_SOURCE. However, because of your patch, the stdio.h is included before _GNU_SOURCE is defined. The result is warnings like this

aisimage.c: In function ?aisimage_generate?:
aisimage.c:313: warning: implicit declaration of function ?getline? kwbimage.c: In function ?kwdimage_set_ext_header?:
kwbimage.c:236: warning: implicit declaration of function ?getline? imximage.c: In function ?parse_cfg_file?:
imximage.c:430: warning: implicit declaration of function ?getline? pblimage.c: In function ?pbl_parser?:
pblimage.c:137: warning: implicit declaration of function ?getline? ublimage.c: In function ?parse_cfg_file?:
ublimage.c:179: warning: implicit declaration of function ?getline?

Quoted 3 lines

I took a quick look at this. It seems that many of the host C files in tools/ define _GNU_SOURCE. Should we just move that #define to the Makefile?

Adding -D_GNU_SOURCE in Makefile can fix this problem.

York

author
#3 lore raw
Quoted 37 lines · York Sun
Quoted 36 lines · Simon Glass

Hi York,

On Tue, Jul 30, 2013 at 3:12 PM, York Sun <[email protected] <mailto:[email protected]>> wrote:

Simon,

Your patch

commit 669dfc2ed8d853d6bcdcafa1de6aca22929465e5
Author: Simon Glass <sjg at chromium.org <mailto:[email protected]>>
Date: Mon Mar 11 06:30:27 2013 +0000

fdt: Ensure that libfdt_env.h comes from U-Boot

adds libfdt_env.h to HOSTCPPFLAGS. The causes a problem with one of our older hosts. On the old hosts, getline prototype is protected by

#ifdef __USE_GNU

This should be OK if the C file has #define _GNU_SOURCE. However, because of your patch, the stdio.h is included before _GNU_SOURCE is defined. The result is warnings like this

aisimage.c: In function ?aisimage_generate?:
aisimage.c:313: warning: implicit declaration of function ?getline? kwbimage.c: In function ?kwdimage_set_ext_header?:
kwbimage.c:236: warning: implicit declaration of function ?getline? imximage.c: In function ?parse_cfg_file?:
imximage.c:430: warning: implicit declaration of function ?getline? pblimage.c: In function ?pbl_parser?:
pblimage.c:137: warning: implicit declaration of function ?getline? ublimage.c: In function ?parse_cfg_file?:
ublimage.c:179: warning: implicit declaration of function ?getline?

Quoted 6 lines
Quoted 3 lines

I took a quick look at this. It seems that many of the host C files in tools/ define _GNU_SOURCE. Should we just move that #define to the Makefile?

Adding -D_GNU_SOURCE in Makefile can fix this problem.

Are you going to send out a patch soon?

York

#4 lore raw
Quoted 41 lines · York Sun
Quoted 10 lines · York Sun
Quoted 9 lines · Simon Glass

Hi York,

On Tue, Jul 30, 2013 at 3:12 PM, York Sun <[email protected] <mailto:[email protected]>> wrote:

Simon,

Your patch

Quoted 7 lines
Quoted 7 lines

commit 669dfc2ed8d853d6bcdcafa1de6aca22929465e5
Author: Simon Glass <sjg at chromium.org <mailto:[email protected]>>
Date: Mon Mar 11 06:30:27 2013 +0000

fdt: Ensure that libfdt_env.h comes from U-Boot

adds libfdt_env.h to HOSTCPPFLAGS. The causes a problem with one of

our

Quoted 20 lines
Quoted 20 lines

older hosts. On the old hosts, getline prototype is protected by

#ifdef __USE_GNU

This should be OK if the C file has #define _GNU_SOURCE. However, because of your patch, the stdio.h is included before _GNU_SOURCE is defined. The result is warnings like this

aisimage.c: In function ?aisimage_generate?:
aisimage.c:313: warning: implicit declaration of function ?getline? kwbimage.c: In function ?kwdimage_set_ext_header?:
kwbimage.c:236: warning: implicit declaration of function ?getline? imximage.c: In function ?parse_cfg_file?:
imximage.c:430: warning: implicit declaration of function ?getline? pblimage.c: In function ?pbl_parser?:
pblimage.c:137: warning: implicit declaration of function ?getline? ublimage.c: In function ?parse_cfg_file?:
ublimage.c:179: warning: implicit declaration of function ?getline?

Quoted 2 lines
Quoted 2 lines

I took a quick look at this. It seems that many of the host C files in tools/ define _GNU_SOURCE. Should we just move that #define to the

Quoted 8 lines

Makefile?

Quoted 4 lines
Quoted 1 line

Adding -D_GNU_SOURCE in Makefile can fix this problem.

Are you going to send out a patch soon?

No, but if you do a patch and cc me I will Ack it :-) Sorry but I can't actually test this case here.

Regards,
Simon