This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
warning: initialization makes integer from pointer without a cast
- From: howarth at bromo dot msbb dot uc dot edu (Jack Howarth)
- To: gcc at gcc dot gnu dot org
- Date: Tue, 28 Mar 2006 16:41:09 -0500 (EST)
- Subject: warning: initialization makes integer from pointer without a cast
I do have one other issue to resolve in this legacy c code which I
am unclear on. The code uses structures of the form..
struct bound_description {
int type;
WORD descr;
} bnddescr[] = {
BNDTYP_NULL, "null",
BNDTYP_BOND, "bond",
BNDTYP_ANGLE, "angle",
BNDTYP_FIXED, "fixed",
BNDTYP_DIHED, "dihed",
BNDTYP_CTLIM, "ctlim",
BNDTYP_BOUND, "bound",
BNDTYP_DIST, "dist",
BNDTYP_EXP, "exp",
BNDTYP_OTHER, "other",
BNDTYP_TRIANGLE,"triang",
NULL
};
where the compiler issuing the warning of...
warning: initialization makes integer from pointer without a cast
...for the line with a NULL. My immediate inclination was to
substitute '0' for the NULL which does indeed eliminate the
warning. Is there a more appropriate fix?
Jack