I can find no way to call execve
that actually compiles without warnings.

If I use:
  char *argv[2];
  argv[0] = _PATH_BSHELL;
  argv[1] = NULL;
  execve(_PATH_BSHELL,argv,environ);

then the first assignment is "discarding
qualifiers".

If I declare argv as "const char *",
then the call to execve() warns about
"incompatible pointer type" for the
second argument.

Reading through SUSv3 I find that the committee
thought that the second argument to execve()
should have been "const char * const *", but
they didn't want old code to generate compiler
warnings.  (Of course, compilers that correctly
type constant strings as "const char *" break
that.)

Does anyone know a good way out of this mess?
(Suggestions to turn off compiler warnings
will be ignored. ;-)

Tim Kientzle


_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to