Bugzilla – Bug 624
Tru64 compatibility fixes
Last modified: 2013-11-17 23:19:47 MST
Created attachment 383 [details] Patch #1 against sudo hg tip Building Sudo on Tru64 required some modifications. The major one was variadic macros (bug #621), but there were a handful of lesser changes needed. The first patch attached here addresses the actual compile errors. One was a simple declaration-after-statement issue; the other was a more unusual situation where 'struct sockaddr' has an 'sa_len' field, but 'struct sockaddr_in' does not have 'sin_len'. The code was assuming that sa_len implied the existence of sin_len---which should be true, by all rights---yet doesn't always happen on this system, thanks to the inconsistent morass of feature test macros used to define the fields of those two structs. The second patch addresses a handful of warnings that I noticed along the way, and problems similar to those: * Numerous #if versus #ifdef mixups. Autoconf symbols are usually defined-or-not-defined, as opposed to zero-or-nonzero, and so should be checked using the latter or "#if defined()". (Incidentally, it may be good to add -Wundef to --enable-warnings; it would have caught many of these.) * debug_return_str() et al. were using const qualifiers needlessly, which caused the compiler to complain when they are dropped in the return-statement cast * Superfluous semicolon
Created attachment 384 [details] Patch #2 against sudo hg tip
The const in debug_return_str was not needless, it is required for fucntions that return const char *. I've just added debug_return_const_str and debug_return_const_pty for those functions with a const return value which should solve the problem. I've committed the other patches so hg tip should have the relevant changes now.
Hm, I think my compile options masked off the places that had const return values, as I didn't see warnings for those. But yes, having a separate macro for them is the way to go. Thanks for getting these in!