Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nntp-server.caltech.edu!manning From: manning@nntp-server.caltech.edu (Evan Marshall Manning) Newsgroups: comp.lang.c Subject: Re: Function pointer casts in ANSI C Message-ID: <1990Dec4.190818.10369@nntp-server.caltech.edu> Date: 4 Dec 90 19:08:18 GMT References: <1990Nov29.110114.21565@diku.dk> <14610@smoke.brl.mil> <1990Nov30.010812.27070@nntp-server.caltech.edu> <1990Dec4.135229.7039@diku.dk> Organization: California Institute of Technology, Pasadena Lines: 26 thorinn@skinfaxe.diku.dk (Lars Henrik Mathiesen) writes: >My question is: Can a conforming compiler generate a warning for casts >(and arguments) that will ``go wrong'' but not for those that work? I wrote: >My favorite lint (from Gimpel) would call those that work "non-portable", >and issue a more serious warning/error message for those that not will >work. thorinn@skinfaxe.diku.dk (Lars Henrik Mathiesen) writes: >Is this lint architecture- and compiler-specific (or configurable) >since it knows what works? Or does it just guess based on two's >complement, byte addressable, 32-bit int and pointer machines? The Gimpel product I use is for PCs only, so it knows everything about the processor architecture. Various flags tell it sizeof int, data pointers, and function pointers. They're pretty good about providing flags for everything reasonable so I'd bet there are one or two extra flags on their more generic product. *************************************************************************** Your eyes are weary from staring at the CRT for so | Evan M. Manning long. You feel sleepy. Notice how restful it is | is to watch the cursor blink. Close your eyes. The |manning@gap.cco.caltech.edu opinions stated above are yours. You cannot | manning@mars.jpl.nasa.gov imagine why you ever felt otherwise. | gleeper@tybalt.caltech.edu Brought to you by Super Global Mega Corp .com