From: Steven M. Schweda [sms@antinode.org] Sent: Monday, February 11, 2008 6:47 PM To: Info-VAX@Mvb.Saic.Com Subject: ODS5, /NAMES = AS_IS, LIBRARY, MMS v. me A long, rambling complaint about the C compiler, the librarian, and MMS follows. In recent years, I've ported some pieces of UNIX-oriented freeware to VMS. Generally, I've done the work on an ODS2 file system, so, if the results are taken back to a non-VMS system, the altered file names must be restored to their original (pre-ODS2) mixed-case, multi-dot forms, which is an annoying extra processing step. With the advent of some ODS5-aware programs, namely, MMS V3.8-2 (DECset 12.8 ECO1), and UnZip 6.0 and Zip 3.0, I thought that it might be productive to re-work one of these projects on an ODS5 disk, where the result should be directly usable on a non-VMS system. Ideally, one Zip kit would be usable on VMS (either ODS2 or ODS5) and UNIX. This seems to be harder than I expected, with problems generally related to ODS5, /NAMES = AS_IS, object libraries, and MMS. It appears that CC /NAMES = AS_IS names an object module according to the name of the source file, preserving its case. For example (on an ODS5 disk): ALP $ cc /vers HP C V7.3-009 on OpenVMS Alpha V7.3-2 ALP $ type lower.c int func_lower( void) { return 1; } ALP $ type UPPER.C int func_upper( void) { return 1; } ALP $ cc /names = as_is LOWER ! The file name, not the command, ALP $ cc /names = as_is upper ! determines the result, as seen below. ALP $ pipe anal /obje LOWER.OBJ | sear sys$input "module name" module name: "lower" ALP $ pipe anal /obje UPPER.OBJ | sear sys$input "module name" module name: "UPPER" I'm open to a clever suggestion, but I see no practical way to change this lower-case module name to an (ODS2-compatible) upper-case module name. (Adding a "#pragma module" directive to every source file is not practical. A clever suggestion here would obviate the remainder of this complaint, however.) This dependence of module names on file name case adds difficulty also when linking using "library-name/INCLUDE=(module-name[,...])", because the module names depend on the underlying file system. Sensing the file system type inside the MMS description file does not look simple, and while I'm always open to a clever suggestion, having to deal with two sets of module dependencies, depending on the file system, sounds like a lot of extra work. Non-upper-case library module names still seem to bewilder MMS, which seems to work only with upper-case module names. You can tell it things like: library.olb : library.olb(lower=lower.OBJ, UPPER=UPPER.OBJ) @ write sys$output " Done." but the result for a lower-case module name involves a GWKACTNOUPD warning. In the old days, it worked this way: alp $ mms /iden %MMS-I-IDENT, MMS V3.5 © 2003 Hewlett-Packard Development Company, L.P. ALP $ mms If "''F$Search("LIBRARY.OLB")'" .EQS. "" Then LIBRARY/Create LIBRARY.OLB LIBRARY/REPLACE LIBRARY.OLB LOWER.OBJ %MMS-W-GWKACTNOUPD, Actions didn't update LIBRARY.OLB(LOWER=LOWER.OBJ) If "''F$Search("LIBRARY.OLB")'" .EQS. "" Then LIBRARY/Create LIBRARY.OLB LIBRARY/REPLACE LIBRARY.OLB UPPER.OBJ Done. This works, after a fashion, but it's sub-optimal, because MMS is never satisfied that the non-upper-case library modules are up-to-date: ALP $ mms If "''F$Search("LIBRARY.OLB")'" .EQS. "" Then LIBRARY/Create LIBRARY.OLB LIBRARY/REPLACE LIBRARY.OLB LOWER.OBJ %MMS-W-GWKACTNOUPD, Actions didn't update LIBRARY.OLB(LOWER=LOWER.OBJ) Done. (Repeat as desired.) Nowadays, it's essentially similar: IT $ cc /vers HP C V7.3-018 on OpenVMS IA64 V8.3-1H1 IT $ mms /iden %MMS-I-IDENT, MMS V3.8-2 © Copyright 2007 Hewlett-Packard Development Company, L P. IT $ cc /names = as_is LOWER IT $ cc /names = as_is upper IT $ pipe anal /obje LOWER.OBJ | sear sys$input "module name" Module name: "lower" IT $ pipe anal /obje UPPER.OBJ | sear sys$input "module name" Module name: "UPPER" IT $ mms If "''F$Search("LIBRARY.OLB")'" .EQS. "" Then LIBRARY/Create LIBRARY.OLB LIBRARY/REPLACE LIBRARY.OLB LOWER.OBJ %MMS-W-GWKACTNOUPD, Actions didn't update LIBRARY.OLB(LOWER=LOWER.OBJ) If "''F$Search("LIBRARY.OLB")'" .EQS. "" Then LIBRARY/Create LIBRARY.OLB LIBRARY/REPLACE LIBRARY.OLB UPPER.OBJ Done. IT $ mms If "''F$Search("LIBRARY.OLB")'" .EQS. "" Then LIBRARY/Create LIBRARY.OLB LIBRARY/REPLACE LIBRARY.OLB LOWER.OBJ %MMS-W-GWKACTNOUPD, Actions didn't update LIBRARY.OLB(LOWER=LOWER.OBJ) Done. One potential solution would be to create an object library which used only upper-case module names. The apparently promising "LIBRARY /CREATE = CASE_SENSITIVE: NO" disappoints. According to the "HP OpenVMS Command Definition, Librarian, and Message Utilities Manual": http://h71000.www7.hp.com/doc/82final/6100/6100pro_005.html#char_case_lbr 2.3 Character Case of Library Keys [...] The CASE_SENSITIVE option works only for macro and text libraries. If you try to use it for other library types, you will get an error message and the library creation operation will abort (no library is created). [...] In fact, there is no error message, and the library is created, but there's no difference in the result. I seem to be out of clever ideas which would let this kind of thing work as I'd like. The best/simplest way out would seem to be to get the compiler to emit an upper-case module name (without having to alter the source file), but I don't see how. Failing that, getting the librarian to up-case the module names would seem helpful, but I don't see how to do that, either. Clever (non-ugly) ideas would be appreciated. ------------------------------------------------------------------------ Steven M. Schweda sms@antinode-org 382 South Warwick Street (+1) 651-699-9818 Saint Paul MN 55105-2547