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

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Mon Feb 10 10:26:18 EST 2014


In article <ldaplh$ura$1 at dont-email.me>, Stephen Hoffman <seaohveh at hoffmanlabs.invalid> writes:
>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


%CC-E-TOOMANYARGS, (1) In this statement, "STR$CONCAT" expects 2 arguments, but 4 are supplied.
----^---- ERROR


$ HELP CC LANGUAGE_TOPICS PREPROCESSOR #PRAGMA

CC

  Language_topics

    Preprocessor

      #pragma

         The #pragma preprocessor directive performs compiler-specific tasks
         as designated by each implementation of the C language.

         All pragmas have a <pragma-name>_m version, which makes the pragma
         subject to macro replacement.  For example, #pragma assert is not
         subject to macro expansion, but #pragma assert_m is.

         All pragmas also have a <pragma-name>_nm version, which prevents
         macro expansion.  For example, #pragma inline is subject to macro
         expansion, but #pragma inline_nm is not.

         There is also a _Pragma operator (C99 Standard), which destringizes
         its string literal argument, effectively allowing #pragma
         directives to be produced by macro expansion.  When specified using
         this operator, the tokens of the pragma, which appear together
         within a single string literal in this form, are not macro
         expanded, even if they have an "_m" suffix.  But macro expansion
         can be accomplished if desired by using the stringization operator
         (#) to form the string.

         The _Pragma operator has the following syntax:

             _Pragma ( string-literal )

         HP C for OpenVMS Systems supports the following #pragma directives:

         :
         :

         #pragma message[_m|_nm]

             Controls the issuance of individual diagnostic messages or
             groups of messages.  Use of this pragma overrides any
             command-line options that may affect the issuance of messages.

             Syntax:

                  #pragma message option1 message-list
                  #pragma message option2
                  #pragma message (quoted-string)

             where option1 is:

                disable             Suppresses the issuance of the indicated
                                    messages.

====>                               Only messages of severity Warning (W) or
====>                               Information (I) can be disabled.  If the
====>                               message has severity of Error (E) or
====>                               Fatal (F), it is issued regardless of
====>                               any attempt to disable it.


-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

Well I speak to machines with the voice of humanity.



More information about the Info-vax mailing list