re: ups/menudata.c

From: Terry R. Friedrichsen (terry_at_uplift.sunquest.com)
Date: Wed Jan 03 2001 - 23:31:10 GMT


Russ wrote:

> ups/menudata.c is generated from the .c files in ups/menus, which are in
> turn generated by the med3 program.  The trialing members Terry mentions
> are initialized at run time.

The difficulty is that it would appear that one of the missing values is
in the *middle*, not at the end.  This seems Bad.  But thanks for the tip
on med3 - I'll go look at that ...



> Does the RedHat compiler (gcc 2.96) generate warnings when trialing members
> of a structure are allowed to default to zero? 

Not by default, but there *are* compilers that generate warnings when ini-
tializer lists are too short.

The problem I encountered was simply that I got 338 copies of:

  warning: initialization makes integer from pointer without a cast

when the compiler hit menudata.c - due to the fact that one of those NULL
pointer values was being stuffed into "long me_save" in the MENU structure.

Not fatal, but *really* annoying.



> ... is it worth while to change med3 to quiet the warnings?

Well, if it was just a matter of one or two warnings, I'd be inclined to say
no.  But this generates *338* warnings, and the initializer lists are in ad-
dition deceptive to the eye because of the NULL initialization of a long
(well, it confused *me*, at any rate :-).

For both of those reasons, my vote (assuming I get one) is "yes".

Terry R. Friedrichsen

terry_at_venus.sunquest.com


This archive was generated by hypermail 2.1.4 : Wed Feb 13 2002 - 21:51:33 GMT