[Info-vax] C... the only winning move is not to play...

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Mon Feb 10 10:02:10 EST 2014


On 2014-02-10 08:35:45 +0000, hb said:

> $ cc x
> 
> int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
> ........................^
> %CC-E-TOOMANYARGS, In this statement, "foo" expects 2 arguments, but 3 
> are supplied.
> at line number 2 in file DISK$USER:[USER]x.c;1
...
> You can just #define the function to something totally different, 
> #undef it later and add the correct prototype...


Or (untested) suppress the error and move on:

#pragma message save
#pragma message disable (TOOMANYARGS)
#pragma message ("Suppressing argument mismatch error secondary to 
str$routines.h definition error in " __FILE__)
str$concat( your, call, here, with, whatever );
#pragma message restore


Here's a similar diagnostic-suppression sequence I use to mask an error 
in a header file that shows when I crank up the compiler diagnostics:

#pragma message save
#pragma message disable (level3,NESTEDCOMMENT)
#include <dvidef.h>
...
#include <stdbool.h>
#pragma message restore


ps: (and entirely unrelated to VAXman's issue with the header files) 
for those folks reading this comp.os.vms newsgroup thread that might be 
interested in a descriptor-like approach for a C project, have a look 
at the <https://github.com/antirez/sds> library.  This library is 
entirely different from VMS string descriptors, but with a similar 
general purpose and can be used where null-terminiated / ASCIZ strings 
are deemed inappropriate.  The library is also rather more portable.





-- 
Pure Personal Opinion | HoffmanLabs LLC




More information about the Info-vax mailing list