Title: | DEC C Problem Reporting Forum |
Notice: | Report DEC C++ problems in TURRIS::C_PLUS_PLUS |
Moderator: | CXXC::REPETE TCHEON |
Created: | Fri Nov 13 1992 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1299 |
Total number of notes: | 6249 |
Problem with -xtaso and -vptr_size_short My sw partner is required to use -xtaso_short and -vptr_size_short due to ObjectStore . We can build with no problem the xx.so files . But we have problem to build the executable . We have some pointers problem convertions . example of message : cxx: Error: /home/wb/kl/Kernel7/prod/DMStd/src/DMStd_GlobalHandle.cxx line 408: In the initializer for domain, the referenced type of the pointer value "&ptr" is "short pointer to char", which is not compatible with "long pointer to char" . Standard_Integer domain = strtol(str,&ptr,10); the man page : long int strtol( const char *nptr, char **endptr, int base); Question do we have problems to translate char **endptr in 32 bits mode ? We use DU V4.0.B and CXX V5.5 .
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1279.1 | --> c_plus_plus | ATYISA::SULOCHA | Wed Mar 19 1997 12:57 | 2 | |
I cross post to c_plus_plus | |||||
1279.2 | strtol wants a 64-bit pointer | CADSYS::GROSS | The bug stops here | Thu Mar 20 1997 09:14 | 12 |
> long int strtol( > const char *nptr, > char **endptr, > int base); I guess you are passing &ptr as the 2nd argument for strtol. "ptr" is 32 bits long but strtol will fetch 64 bits. That will include 32 bits that aren't even a part of "ptr". You need to move the pointer value into a real 64-bit pointer variable in order to call strtol. Dave | |||||
1279.3 | DECC::ZAHAREE | Linda D. Zaharee | Thu Mar 20 1997 09:24 | 15 | |
From the documentation: -xtaso_short Enables the use of short pointers. All pointer types default to short pointers. Long pointers can be declared though the use of the pointer_size pragmas. Because all system routines continue to use 64-bit pointers, most applications require source changes when used in this way. You need to use a 64-bit pointers when calling strtol. You can do this through the use of #pragma pointer_size. Linda. |