[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2067.0. "bad assembler code generated by illegal size argument." by BACHUS::SABLON (Mich�le Sablon, TP/IM Support Belgium 856-7238) Tue Jan 21 1997 09:30

T.RTitleUserPersonal
Name
DateLines
2067.1QAR it on GORGECXXC::REINIGThis too shall changeTue Jan 21 1997 10:034
2067.2change in maximum size of argument passed by value ?BACHUS::SABLONMich�le Sablon, TP/IM Support Belgium 856-7238Wed Jan 22 1997 04:566
2067.3Only limits are system imposed limitsCXXC::REINIGThis too shall changeWed Jan 22 1997 09:4885
2067.4Although the error is documented: ARGSIZEBACHUS::SABLONMich�le Sablon, TP/IM Support Belgium 856-7238Mon Feb 10 1997 05:2714
Stranger and stranger...

The error was generated on UNIX, and also on VMS where you can find it
documented: error code ARGSIZE.

$ HELP cc/decc messages ARGSIZE

        Message        <Context> the size of "<expression>" exceeds the
                       implementation's limit of 32767 bytes on the size of
                       a function argument.

So there must be somewhere (sometimeS ?) an limit ?!

Mich�le.
2067.5UNIX != VMSCXXC::REPETERich Peterson 381-1802 ZKO2-3/N30Tue Feb 11 1997 15:2325
Original report in .0 was against old C compiler on UNIX.  Replies indicate
no limit in current UNIX C compiler.  The old C compiler on UNIX had a
particular implementation limit involving the addressing of arguments
passed on the stack that was not in the DEC C compiler on UNIX.

But .4 is a reference to a VMS help file.  Things are different on VMS,
where if nothing else there is an argcount register that has one byte
allocated to hold the number of arguments actually passed to a function.

Some older VMS DEC C compilers complained about large arguments, but
the diagnostic was not accurately based on the actual problem-causing
limitation.  On VAX, it would complain if there were more than 255
arguments, or if a single argument was larger than 32767 bytes.  But
in fact problems would occur on VAX if there were more than 255 arguments
or if the sum of the sizes of all the arguments exceeded 1024 bytes.
The former situation would result in incorrect values of va_count,
the latter would result in the function return incrementing the
stack pointer by the total argument size mod 1024, effectively producing
a memory leak in the program's stack.

Starting with V5.2, the VMS DEC C compilers diagnose the problem more
accurately: both Alpha and VAX produce an informational when the
number of arguments exceeds the calling standard max of 255.  And on
VAX only, an extra warning is given when the total size of all arguments
would cause code to be generated that would leak stack space.
2067.6BACHUS::SABLONMich�le Sablon, TP/IM Support Belgium 856-7238Mon Feb 17 1997 05:5124
Hi Rich,

Thanks for you explanation, but it doesn't explain everything.

1. On one hand there is a problem with the UNIX old C. It is QARed (#51143) and 
   I still hope to ever get an answer to it.

2. On the other hand, I test the program compilation using the DEC C compiler. 
   This sometimes help. Under OSF V3.2D, the compilation fails with the ARGSIZE 
   error message. Which is only documented in the VMS doc ! I couldn't test the 
   program under VMS: to much includes which doesn't exist.

   Under OSF V4.0, the compilation in DEC C is OK: no error generated.

3. From your answer, I understand that this error should only be reported from
   VAX compilation. How can it be issued by OSF one ?

4. You said �The old C compiler on UNIX had a particular implementation limit 
   involving the addressing of arguments passed on the stack that was not in 
   the DEC C compiler on UNIX.� This seems to be the answer to point 1 but I 
   could find any such information. Is it documented somewhere ?

Thanks in advance,
Mich�le.
2067.7Bugs can explain almost anythingCXXC::REPETERich Peterson 381-1802 ZKO2-3/N30Tue Feb 18 1997 14:0012
> 3. From your answer, I understand that this error should only be reported from
>    VAX compilation. How can it be issued by OSF one ?

Due to an unintentional feature in that version of compiler.

> 4. You said �The old C compiler on UNIX had a particular implementation limit 
>    involving the addressing of arguments passed on the stack that was not in 
>    the DEC C compiler on UNIX.� This seems to be the answer to point 1 but I 
>    could find any such information. Is it documented somewhere ?

Like much information about the detailed behavior of the -oldc compiler,
this is by observation, not by documentation.