donr
2005-01-10 16:10:44 UTC
Hi all,
I am migrating an application for SCO Xenix to SCO OpenServer 5.0.7.
There are some modules that have funcions in the form:
extern f(short, char[], char[]);
.
.
.
extern f(a, b, c)
short a;
char b[];
char c[];
{
}
Without the prototype, the compiler is happy. With the prototype, I
would get the warning:
type does not match prototype: a
I would get this warning for any object that is not or would not be
(i.e. pointers) the size of an int. What is the compiler trying to tell
me? If I compile this on a Sun compiler with its default -t option, I
get a similar warning and also that the old style declaration short is
being promoted to int. The Sun compiler displays the warning but I
don't think it actually does the promotion with this option. Is the SCO
compiler doing the promotion and that's why the warning?
If it's doing the promotion, what happens when this function is called
in another module with these types, especially in the case where there
is no prototype in this module? Does it push the data types specified
and pop ints? This would create some interesting behavior. Did pre-ansi
C push and pop ints? It seems protoypes were used in the defining
module if the function is called within this module and defined after
the calls. If it was defined first or not called in the defining
module, there is no prototype in the module.
I can fix it by doing the ansi format. However, an older version of
Informix is used in some places and esql doesn't like the ansi format.
So I have a bit of a catch 22. I am investagating a newer version of
Informix through informix.com but haven't yet gotten a response. Does
anyone know if there is a version for this O/S? I would think there
would be.
Thanks for input and help.
Don
I am migrating an application for SCO Xenix to SCO OpenServer 5.0.7.
There are some modules that have funcions in the form:
extern f(short, char[], char[]);
.
.
.
extern f(a, b, c)
short a;
char b[];
char c[];
{
}
Without the prototype, the compiler is happy. With the prototype, I
would get the warning:
type does not match prototype: a
I would get this warning for any object that is not or would not be
(i.e. pointers) the size of an int. What is the compiler trying to tell
me? If I compile this on a Sun compiler with its default -t option, I
get a similar warning and also that the old style declaration short is
being promoted to int. The Sun compiler displays the warning but I
don't think it actually does the promotion with this option. Is the SCO
compiler doing the promotion and that's why the warning?
If it's doing the promotion, what happens when this function is called
in another module with these types, especially in the case where there
is no prototype in this module? Does it push the data types specified
and pop ints? This would create some interesting behavior. Did pre-ansi
C push and pop ints? It seems protoypes were used in the defining
module if the function is called within this module and defined after
the calls. If it was defined first or not called in the defining
module, there is no prototype in the module.
I can fix it by doing the ansi format. However, an older version of
Informix is used in some places and esql doesn't like the ansi format.
So I have a bit of a catch 22. I am investagating a newer version of
Informix through informix.com but haven't yet gotten a response. Does
anyone know if there is a version for this O/S? I would think there
would be.
Thanks for input and help.
Don