Missing declaration of AlDataBase_t

I use a language database and wrote the code according to Photons microGUI
Programmer’s Guide. Almost everything works fine: no warning is generated
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;
src\Callbacks.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?

Walter

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;
src\Callbacks.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?

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

Walter Hauser wrote:

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?

These messages don’t look like they’re complaining about the typedef in
Al.h – they’re more consistent with code that does not include Al.h at
all. Do you have an #include <photon/Al.h> line in your code?

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

Wojtek Lerch wrote:

Walter Hauser wrote:
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?

These messages don’t look like they’re complaining about the typedef in
Al.h – they’re more consistent with code that does not include Al.h at
all. Do you have an #include <photon/Al.h> line in your code?

PC-lint for C/C++ (NT) Vers. 8.00r, Copyright Gimpel Software 1985-2005

— Module:
E:workspaceHysteromat_NT_ExportHysteromat_NTsrcCallbacks.c
v
static AlDataBase_t *fdLngDB;
E:workspaceHysteromat_NT_ExportHysteromat_NTsrcCallbacks.c 26 Info
808: No explicit type given symbol ‘AlDataBase_t’, int assumed

E:workspaceHysteromat_NT_ExportHysteromat_NTsrcCallbacks.c 26 Error
10: Expecting ‘;’

v
fdLngDB = AlOpenDBase ("/root/workspace/Hysteromat_NT/Hysteromat_NT.ldb");
E:workspaceHysteromat_NT_ExportHysteromat_NTsrcCallbacks.c 74 Error
40: Undeclared identifier ‘fdLngDB’

E:workspaceHysteromat_NT_ExportHysteromat_NTsrcCallbacks.c 74 Info
718: Symbol ‘AlOpenDBase’ undeclared, assumed to return int

E:workspaceHysteromat_NT_ExportHysteromat_NTsrcCallbacks.c 74 Info
746: call to function ‘AlOpenDBase()’ not made in the presence of
a prototype

E:workspaceHysteromat_NT_ExportHysteromat_NTsrcCallbacks.c 74 Error
63: Expected an lvalue

Sincerely
Walter

Yes, <photon\al.h> is included. Anyway, you brought me to the idea to
exchange the order of <photon\al.h> and its predecessor <unistd.h>: this
will solve the problem! (I don’t ask why …)

Thanks a lot for your help!
Walter

Walter Hauser wrote:

Yes, <photon\al.h> is included. Anyway, you brought me to the idea to
exchange the order of <photon\al.h> and its predecessor <unistd.h>: this
will solve the problem! (I don’t ask why …)

That’s strange. But the program compiles no matter what the order is,
correct? Is there a chance that your lint uses a different search order
for headers and picks up some different files? If it finds some strange
<unistd.h> that happens to define a macro named AL_H_INCLUDED, that
would explain why all the contents of Al.h get ifdefed out when you
include <unistd.h> first…