[Balloon] Balloon Bootldr YAFFS code compiler warnings and p…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Colin Tuckley
Date:  
To: Balloon
Subject: [Balloon] Balloon Bootldr YAFFS code compiler warnings and possible bug
I'd like some help with solving a possible bug.

When I compile the bootldr code with gcc 3.3 I get the following warning
from yaffs_guts.c:

yaffs/yaffs_guts.c: In function `yaffs_GetObjectName':
yaffs/yaffs_guts.c:5747: warning: implicit declaration of function
`yaffs_sprintf'

I originally had several similar ones which I've fixed. However this one has
brought to light something which I think might be a bug.

The line causing the warning is:

yaffs_sprintf(locName, _Y("%s%d"), YAFFS_LOSTNFOUND_PREFIX, obj->objectId);

The definition of yaffs_sprintf is in yaffscmds.c and looks like this:

const char *yaffs_sprintf(char *buff, const char *format) {
    *buff=0;
    return "";
}


There are other #define type declarations for yaffs_sprintf that look like:

#define yaffs_sprintf(a,b,c,d) sprintf(a,b,c,d)

but they are in areas of code inside unsatisfied conditional compilation
directives.

grep shows me that this is the only call to the function.

So... it seems that the call (with 4 arguments) is being satisfied with a
function that only expects 2 arguments. I'm not an expert on the calling
mechanism but this seems like a bad idea.

I haven't (yet) had a good look through the yaffs code but it would seem
that the code is designed to be multi-purpose as far as environments and
platforms are concerned. I suspect that it's only in the bootldr very
simple/bare environment that this problem occurs.

How do we fix this?

regards,

Colin

-- 
Colin Tuckley      |    |  PGP/GnuPG Key Id
+44(0)1903 236872  |  +44(0)7799 143369  |     0x1B3045CE


"Apple" (c) Copyright 1767, Sir Isaac Newton.