Wojtek Lerch wrote:
Walter Hauser wrote:
I use a language database and wrote the code according to Photons microGUI
Programmer’s Guide. Almost everything works fine: no warning is generated
Is that an application that simply uses a message database, or is it a
tool for creating or editing translation files? The Al functions are
meant for the latter, not the former.
by the compiler (3.3.1) even with level 9, linking is done successful and
when I run the image it works like expected.
But when I lint the code Lint misses a declaration of AlDataBase_t and
reports it as an error:
static AlDataBase_t *fdLngDB;
srcCallbacks.c 24 Info 808: No explicit type given symbol
‘AlDataBase_t’, int assumed
All searches of every kind for AlDataBase_t will find only a typedef in
Al.h: typedef struct Al_db AlDataBase_t;
Does anybody knows where the declaration of Al_db resides?
The full contents of that structure are only defined in the source file
that implements the Al functions. You don’t have that file.
As far as your code is concerned, “struct Al_db” is an incomplete
structure type. You can’t create your own objects that have that type,
only pass around pointers to it. The API was designed that way for purpose.
Anyway, the message from lint is misleading: the line from Al.h that you
quoted does give an explicit (albeit incomplete) type to the symbol
AlDataBase_t. It’s silly for lint to assume that “struct Al_db” is int
– what version of lint is that?
Thank you for the prompt answer. Here is the complete output from Lint
around the declaration and the implementation. Is there a chance to make a
workaround without the missing source file?
PC-lint for C/C++ (NT) Vers. 8.00r, Copyright Gimpel Software 1985-2005
— Module:
E:\workspace\Hysteromat_NT_Export\Hysteromat_NT\src\Callbacks.c
v
static AlDataBase_t *fdLngDB;
E:\workspace\Hysteromat_NT_Export\Hysteromat_NT\src\Callbacks.c 26 Info
808: No explicit type given symbol ‘AlDataBase_t’, int assumed
E:\workspace\Hysteromat_NT_Export\Hysteromat_NT\src\Callbacks.c 26 Error
10: Expecting ‘;’
v
fdLngDB = AlOpenDBase ("/root/workspace/Hysteromat_NT/Hysteromat_NT.ldb");
E:\workspace\Hysteromat_NT_Export\Hysteromat_NT\src\Callbacks.c 74 Error
40: Undeclared identifier ‘fdLngDB’
E:\workspace\Hysteromat_NT_Export\Hysteromat_NT\src\Callbacks.c 74 Info
718: Symbol ‘AlOpenDBase’ undeclared, assumed to return int
E:\workspace\Hysteromat_NT_Export\Hysteromat_NT\src\Callbacks.c 74 Info
746: call to function ‘AlOpenDBase()’ not made in the presence of
a prototype
E:\workspace\Hysteromat_NT_Export\Hysteromat_NT\src\Callbacks.c 74 Error
63: Expected an lvalue
Sincerely
Walter