Skip to contentSkip to conversation

opkg-sdk_svn build failure

DISCUSSION Dmitry Vinokurov 3 participants 5 messages Nov 24, 2009 – Dec 27, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

I'm trying to build QTE SDK according to OE manual chapter "Creating and Using a Qt Embedded SDK". Command "bitbake meta-toolchain-qte" fails with:
---------------------------------------
ERROR: function do_compile failed
ERROR: see log in /home/raydan/work/oe/build/tmp/work/x86_64-armv5te-sdk-oe-linux-gnueabi/opkg-sdk-0.1.6+svnr363-r16/temp/log.do_compile.19556
---------------------------------------

Tail of log contains following lines:
---------------------------------------
cc1: warnings being treated as errors
hash_table.c: In function 'hash_print_stats':
hash_table.c:81: error: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
---------------------------------------

Ready to provide any additional information, if needed.

Signature · 1 line
Best Regards, Dmitry Vinokurov <[email protected]>
#1 lore raw
Quoted 9 lines · Dmitry Vinokurov

Hello,

I'm trying to build QTE SDK according to OE manual chapter "Creating and Using a Qt Embedded SDK". Command "bitbake meta-toolchain-qte" fails with:
---------------------------------------
ERROR: function do_compile failed
ERROR: see log in /home/raydan/work/oe/build/tmp/work/x86_64-armv5te-sdk-oe-linux-gnueabi/opkg-sdk-0.1.6+svnr363-r16/temp/log.do_compile.19556

---------------------------------------

Quoted 9 lines

Tail of log contains following lines:
---------------------------------------
cc1: warnings being treated as errors
hash_table.c: In function 'hash_print_stats':
hash_table.c:81: error: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
---------------------------------------

Ready to provide any additional information, if needed.

Possible patch to include in opkg.inc attached.

--
Best Regards, Dmitry Vinokurov <[email protected]>

libopkg/hash_table.c renamed from libopkg/hash_table.c.orig +0 -0
@@ -64,7 +64,7 @@

void
hash_print_stats(hash_table_t *hash)
{
- printf("hash_table: %s, %d bytes\n"
+ printf("hash_table: %s, %ld bytes\n"

		"\tn_buckets=%d, n_elements=%d, n_collisions=%d\n"
		"\tmax_bucket_len=%d, n_used_buckets=%d, ave_bucket_len=%.2f\n"
		"\tn_hits=%d, n_misses=%d\n",
#2 lore raw

sizeof returns long unsigned int on x86_64. This is fixed in r365.

#3 lore raw
Quoted 1 line · Graham Gower

sizeof returns long unsigned int on x86_64. This is fixed in r365.

sizeof return size_t which is a type in itself so if you want portability between 32-bit and 64-bit systems you should probably use 'z' length modifier in printf formats. '%zd' would work correctly irrespective of word lenght of the processor. You need C99 compliant compiler though.

Thanks

-Khem

Quoted 5 lines

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#4 lore raw

2009/12/27 Khem Raj <[email protected]>:

Quoted 9 lines · Graham Gower
Quoted 1 line

sizeof returns long unsigned int on x86_64. This is fixed in r365.

sizeof return size_t which is a type in itself so if you want portability between 32-bit and 64-bit systems you should probably use 'z' length modifier in printf formats. '%zd' would work correctly irrespective of word lenght of the processor. You need C99 compliant compiler though.

Quoted 3 lines

Thanks

-Khem

You're right. r365 casts it to an int instead, in an attempt to maintain portability.