GCC >= 3 and C99 handle zero-length arrays differently than older

versions of GCC.  With this change, sysinstall compiles and works fine
with GCC 3.1 or 2.95.
This commit is contained in:
murray 2002-04-07 10:27:24 +00:00
parent f74fcb3feb
commit 14aed863ca
2 changed files with 12 additions and 0 deletions

View File

@ -214,7 +214,13 @@ typedef struct _dmenu {
char *prompt; /* Our prompt */
char *helpline; /* Line of help at bottom */
char *helpfile; /* Help file for "F1" */
#if (__STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3)
dialogMenuItem items[]; /* Array of menu items */
#elif __GNUC__
dialogMenuItem items[0]; /* Array of menu items */
#else
#error "Create hack for C89 and K&R compilers."
#endif
} DMenu;
/* An rc.conf variable */

View File

@ -214,7 +214,13 @@ typedef struct _dmenu {
char *prompt; /* Our prompt */
char *helpline; /* Line of help at bottom */
char *helpfile; /* Help file for "F1" */
#if (__STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3)
dialogMenuItem items[]; /* Array of menu items */
#elif __GNUC__
dialogMenuItem items[0]; /* Array of menu items */
#else
#error "Create hack for C89 and K&R compilers."
#endif
} DMenu;
/* An rc.conf variable */