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

Conference turris::decc_bugs

Title:DEC C Problem Reporting Forum
Notice:Report DEC C++ problems in TURRIS::C_PLUS_PLUS
Moderator:CXXC::REPETETCHEON
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

1279.0. "-xtaso_short and strtol" by ATYISA::SULOCHA () Wed Mar 19 1997 12:16

    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.RTitleUserPersonal
Name
DateLines
1279.1--> c_plus_plusATYISA::SULOCHAWed Mar 19 1997 12:572
    I cross post to c_plus_plus
    
1279.2strtol wants a 64-bit pointerCADSYS::GROSSThe bug stops hereThu Mar 20 1997 09:1412
>     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.3DECC::ZAHAREELinda D. ZahareeThu Mar 20 1997 09:2415
    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.