On 22-Jan-99 Jean-Marc Lasgouttes wrote:
>>>>>> "Carl" == Carl Ollivier-Gooch <[EMAIL PROTECTED]> writes:
>
>>> 2) Lines like [lyx.C:15] FD_form_title *fdui = (FD_form_title *)
>>> fl_calloc(1, sizeof(*fdui)); gives the warning from AIX's xlC
>>> "lyx.C", line 15.64: 1540-101: (W) "fdui" may be used before being
>>> set.
>
>Carl> This should be
>
>Carl> FD_form_title *fdui = (FD_form_title *) fl_calloc(1,
>Carl> sizeof(FD_form_title));
>
>Carl> to keep xLC (and other equally picky compilers) from
>Carl> complaining. As Jean-Marc said, xforms does this automatically.
>Carl> I'm attaching a new version of fdfix.sh that uses sed
>Carl> (awkwardly, I think) to make this change. The patch for this
>Carl> one would be nearly as long as the file, including the comments
>Carl> I added about the cryptic sed commands that I added.
>
>It seems to me then the following simpler sed rule works equally well:
>-e 's/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/'
Hey, if it works, that's great. I'm absolutely not an expert on sed, to
the extent that I can barely read the rule you propose. (If I didn't know
what it was supposed to do, I'd never be able to tell...) By all means,
use the simpler version.
Carl
----------------------------------
Carl Ollivier-Gooch [EMAIL PROTECTED]
Department of Mechanical Engineering Voice: +1-604-822-1854
University of British Columbia Fax: +1-604-822-2403
2324 Main Mall URL: http://www.mech.ubc.ca/~cfog
Vancouver, BC V6T 1Z4 Canada
----------------------------------