[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] ABI problem with: [PATCH v2] add multi extent ISO9660 fi

From: Thomas Schmitt
Subject: [Libcdio-devel] ABI problem with: [PATCH v2] add multi extent ISO9660 file support to libcdio
Date: Wed, 27 Jun 2018 12:22:09 +0200


sorry, my demand to move the new members to the end of iso9660_stat_s
is poisonous.

Currently it looks like we will have to choose between a SONAME version
jump and implementing a complete new class for the ISO 9660 objects
which are currently represented by struct iso9660_stat_s.

See what's wrong with appending new members to iso9660_stat_s:

While pondering methods to avoid memory leaks with dynamic memory,
i came to this gesture in include/cdio/iso9660.h:

  #define EMPTY_ARRAY_SIZE 0
  struct iso9660_stat_s { /* big endian!! */
    char         filename[EMPTY_ARRAY_SIZE]; /**< filename */

What ?
  "Declaring zero-length arrays is allowed in GNU C as an extension.
   A zero-length array can be useful as the last element of a structure
   that is really a header for a variable-length object"
  "C99, ยง16: As a special case, the last element of a structure
   with more than one named member may have an incomplete array type;
   this is called a flexible array member.

So the opportunity to expand iso9660_stat_s in an ABI compatible way is
already used up. (Damn ingenious programming ! The fine art must be in the
model, not in the code.)

Have a nice day :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]