Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!purdue!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!hagbard!sunic!mcsun!unido!fauern!tumuc!guug!ott From: ott@guug.guug.de (Joachim Ott Munich-Germany) Newsgroups: comp.unix.sysv386 Subject: Re: Replacement su for SCO Unix Summary: '?:' warning may be okay Keywords: SCO, su Message-ID: <143@guug.guug.de> Date: 30 Sep 90 07:17:42 GMT References: <1990Sep20.163355.7147@robobar.co.uk> <1990Sep21.143435.9810@dce.ie> Sender: ott@guug.guug.de (Joachim Ott Munich-Germany) Organization: GUUG e.V., Munich, W.-Germany Lines: 16 In article , em@dce.ie (Eamonn McManus) writes: > ... > X const char *user = "root", *shell = NULL; ^^^^^^^^^^^^^ > ... > X The stupid Microsoft compiler warns about the ?: below. Ignore it. > X Better still, use GNU C. */ > X su(pwd, login, shell ? shell : pwd->pw_shell, argv + i - 1); ^^^^^^^ Not really stupid (i must admit to microsoft). 'shell ?' means 'shell != 0' and *not* 'shell != NULL'. You should not rely on NULL being the same as 0. Try the line with '(shell != NULL) ?', the warning should be gone. Tell GNU-people to fix this in their compiler.