[U-Boot-Users] Warnings caused by const qualifier in include/s3c2410h

Martin Krause Martin.Krause at tqs.de
Tue Dec 12 16:13:07 CET 2006


Hello List,

if I compile U-Boot for the smdk2410, I get the following warnings:

mkr at tq-sewsrv-4:~/git/u-boot_trab2> ./MAKEALL smdk2410
Configuring for smdk2410 board...
In file included from smdk2410.c:29:
/home/mkr/git/u-boot_trab2/include/s3c2410.h:73: warning: type qualifiers ignored on function return type
/home/mkr/git/u-boot_trab2/include/s3c2410.h:77: warning: type qualifiers ignored on function return type
[...]

The source of the warnings are function definitions like this
(from include/s3c2410.h):

static inline S3C24X0_MEMCTL * const S3C24X0_GetBase_MEMCTL(void)
{
	return (S3C24X0_MEMCTL * const)S3C24X0_MEMCTL_BASE;
}

In my opinion the 'const' qualifier for the return value is the cause
of the warning. In the header file for the older S3C2400 cpu 
(include/s3c2400.h) the functions were defined without this qualifier:

static inline S3C24X0_MEMCTL * S3C24X0_GetBase_MEMCTL(void)
{
	return (S3C24X0_MEMCTL * const)S3C24X0_MEMCTL_BASE;
}

And with this definition the compiler produces no warnings.

Are the additional 'const' qualifiers in the s3c2410.h definitions of 
any use? In my opinion they could be removed (without side effects??).
I could provide a patch, if this is the right way to go.

Regards

---
Martin Krause

TQ-Systems GmbH
Mühlstraße 2, Gut Delling, 82229 Seefeld
Tel. +49 (8153) 93 08-157, Fax +49 (8153) 93 08-7157
martin.krause at tqs.de
www.tq-group.com




More information about the U-Boot mailing list