pointers, tests, casts

Rahul Dhesi dhesi at bsu-cs.UUCP
Sat Nov 26 01:10:35 AEST 1988


In article <8961 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>)
writes:
>	execl( "/bin/sh", "-sh", "-i", 0 );
>...The bug typified by this is seen in a
>LOT of code ("well it worked on MY machine!").

Sadly, the only UNIX programming textbook I've seen on the market, by
Rochkind, consistently uses 0 and NULL as actual parameters without any
cast.  This may be because Rochkind did all his programming using Venix
on an IBM XT, and the Venix compiler does not support any memory model
in which ints and char pointers are of different sizes.

There is probably an entire generation of future programmers ready to
graduate and begin planting execl(...., 0) timebombs in production
code.
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!dhesi



More information about the Comp.lang.c mailing list