Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Modula 2 > Re: TS and an a...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 281 of 382
Post > Topic >>

Re: TS and an address of a const?

by Marco van de Voort <marcov@[EMAIL PROTECTED] > Jun 9, 2006 at 11:10 AM

On 2006-06-09, |||newspam|||@[EMAIL PROTECTED]
|||newspam|||@[EMAIL PROTECTED]
> wrote:
> Will do what you want in this case. And with M2 compilers this will be
> type safe so that you cannot accidentally overrun the buffer. You may
> have to set appropriate compiler pragmas to prevent the call by value
> copying the constant data before the call.
>
> If you are intending to call any C code that assumes null terminated
> strings it would be wise to make the destination buffer one character
> longer than the max number of characters in your longest possible
> string.

I'm not 100% sure, but IIRC it is better to make it two. 
At least some implementations of 16-bit chars (UTF16 or precursors)
terminate using double zero, and don't calculate the bufsize correctly.
 




 5 Posts in Topic:
TS and an address of a const?
"AC Joubert" &l  2006-06-08 18:27:12 
Re: TS and an address of a const?
comp.lang.modula2@[EMAIL   2006-06-08 19:37:59 
Re: TS and an address of a const?
|||newspam|||@[EMAIL PROT  2006-06-09 03:32:52 
Re: TS and an address of a const?
Marco van de Voort <ma  2006-06-09 11:10:09 
Re: TS and an address of a const?
|||newspam|||@[EMAIL PROT  2006-06-09 03:52:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 7:33:25 CDT 2008.