|
Re: bug while wrapping const char arrays without an explicitly defined size: msg#00190programming.swig
David Beazley wrote: Marcelo Matus writes:And that is the way the 'char *' datatype is working, nothing has been changed, that is what we call "strings", ie, the one that always have a NULL ending character. The thing is that 'char*' and 'char[ANY]' are different, in C you can always get sizeof(char[ANY]) -> ANY, you don't need to use strlen because the size is known, C doesn't require the char[ANY] to be NULL-terminated, etc. And the size part was the thing the char[ANY] typemap was trying to capture, ie, if you define char[20], you always get a string of size 20, no matter if you have a NULL char or not. But I will add the code to delete the ending NULL chars by default, so, char *, char[ANY] and char[] will look more alike. Should we also need to add something to the docs saying that the same rules for the char * datatype will apply to char[ANY] and char[]? Marcelo All C string strings regardless of specification (array, pointers, _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: warnings when using directors with multiple throw specifiers: 00190, William S Fulton |
|---|---|
| Next by Date: | Re: bug while wrapping const char arrays without an explicitly defined size: 00190, David Beazley |
| Previous by Thread: | Re: bug while wrapping const char arrays without an explicitly defined sizei: 00190, David Beazley |
| Next by Thread: | Re: bug while wrapping const char arrays without an explicitly defined size: 00190, David Beazley |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |