This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sprintf argument restriction

Hi,

A question regarding C51 v6.23a...

The C51 manual suggests that, using the 'large' memory model, sprintf is restricted to a 40 byte parameter list.

Having used this knowledge to resolve a bug whose presence is caused by a sprintf call exceeding the 40 byte limit, I was curious as to why the compiler hadn't warned me of this situation. It does seems however, if a sprintf call is made using more than 32 arguments (i.e. irrespective of actual byte count) the compiler does warn of this situation.

What gives? Is the restriction byte oriented (as I suspect), in which case why no compiler warning for erroneous sprintf calls, or is it argument count related, as the compiler seems to treat it?

Thanks for any illumination.

David