Re: Need info on the use of certain datastructures and the first C++ keyword patch for 2.2.17

From: Keith Owens (kaos@ocs.com.au)
Date: Mon Oct 30 2000 - 07:46:30 EST


On Mon, 30 Oct 2000 13:00:06 +0100,
"J . A . Magallon" <jamagallon@able.es> wrote:
>And what about struct fields ? It is the same. If you change the name of a field
>permanently, you have to modify the C source that uses it. But names are not
>important for binary compatability, so you can make things like:
>struct data {
> int field1;
>#ifndef __cplusplus
> double new;
> int class;
>#else
> double dnew;
> int klass;
>#endif
>};

Names *are* important for binary compatibilty on modules. If you
compile with symbol versions, the field names within a structure are
included in the checksum that is generated for the overall structure.
If you declare different names depending on compile time options then
genksyms says that they are different structure definitions, you will
get a mismatch on the checksum of exported symbols and will not be able
to load the modules.

There is also the less important problem of confusing debuggers. The
data that is saved when you compile with -g will be different in
various modules, a possible source of confusion.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 31 2000 - 21:00:26 EST