Compiling SAMBA with better options
B. Z. Lederman
lederman at Encompasserve.org
Thu Mar 27 15:48:06 GMT 2003
I've been looking more at the source code and the way it's
compiled.
/STANDARD=VAXC is really not a good choice. It covers up too
many real and potential problems in the code.
I decided to try compiling with a better set of options which
I have included below. (the /ARCH = HOST isn't essential, but it
helps if the code is going to execute on the same architecture as
it's compiled.) I got a lot of warnings about locally declared
prototypes (PROTOSCOPE): these aren't always problems, but they
can be if the function is used in more than one place. So I have
(for now) told the compiler not to issue any warnings about that
one particular potential problem. There are other checks that
could be included in the /CHECK qualifier, and when the currently
known problems are addressed perhaps a /CHECK or even a
/CHECK=ALL should be done.
There is also a question of what to do with names that are
longer than 31 characters. I don't know what ANSI says about it,
but they're a potential problem on OpenVMS. There is work going
on to address this, but for now removing the /STANDARD=VAXC
means usually choosing a method of dealing with names. I tried
/NAMES = (AS_IS, SHORTENED) which shortens the names in a
predictable manner. However, I got errors linking the
executables because some names didn't match. I think /NAMES =
(UPPERCASE, SHORTENED) would be better and I intend to try that.
A lot of the code compiles cleanly with this set of options,
which it should. When the compiler flags something, it's usually
a real problem, and something which would be a problem on any
platform. For example, there are many cases where an unsigned
variable is being compared to a signed constant or value.
I also edited two modules:
[SAMBA-2_2_7A-SRC.SOURCE.VMS] VMS_SUPPORT.C
for the previously discussed problem with getdvi instead of getdviw
and
[SAMBA-2_2_7A-SRC.SOURCE.SMBD] CLOSE.C
because it calls sys$open, sys$close, etc. without the
functions being defined. Modules that call these functions are
better off if they #include <starlet.h> to define the function
prototypes. There are a couple of other modules where this should
be done.
The compiler command I used is:
$ cc := CC/DECC/NOLIST/INCLUDE=([],[.INCLUDE],[.UBIQX],[.SMBWRAPPER],[.tdb],[.popt],[.VMS]) -
/DEFINE=(WITH_SMBPASSWD_SAM, HAVE_IFACE_IFCONF) /NESTED = PRIMARY -
/ARCH = HOST /ASSUME = WHOLE /CHECK = (UNINIT, POINTER = ALL) -
/LIST /CROSS /SHOW = BRIEF /PREFIX = ALL /OPT = LEVEL = 5 -
/NAMES = (AS_IS, SHORTENED) /WARN = DISABLE = PROTOSCOPE
The number of modules with warnings is longer than I would
post to the mailing list by default (if you include the entire
message, which includes a pointer to the code with an
explanation). I can mail it, or you can pick it up from a web
site. My personal web site is:
http://encompasserve.org/~lederman/index.html
There should be a pointer to samba1.txt
and samba1.zip
which has the results of my compilation.
More information about the samba-vms
mailing list