This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]