- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: strtok_r 64 BIT HP unix
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 10:28 PM
02-23-2004 10:28 PM
strtok_r 64 BIT HP unix
When compiled in 64 Bit it gives warning.
and on usage it gives core dump.
Have any one faced similar problem ,thought confirm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 10:32 PM
02-23-2004 10:32 PM
Re: strtok_r 64 BIT HP unix
http://hpux.connect.org.uk/hppd/hpux/Development/Tools/TS-1.08/
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 10:46 PM
02-23-2004 10:46 PM
Re: strtok_r 64 BIT HP unix
Weird! I'll keep playing with that!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 10:52 PM
02-23-2004 10:52 PM
Re: strtok_r 64 BIT HP unix
Maybe you are doing the same thing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 11:14 PM
02-23-2004 11:14 PM
Re: strtok_r 64 BIT HP unix
#include
#include
#include
void main(){
char usr[36];
char *name[5];
char *arr=NULL;
memset(usr,'\0',sizeof(usr));
strcpy(usr,"ab cd ef");
name[0]=(char *)strtok_r(usr," ",&arr);
printf("arr is %s\n",arr);
printf("name is %s\n",name[0]);
return ;
}
[node:/tmp]
Compilation Trace:
cc +DD64 -g -o t1 t1.c
cc: 487: warning : Possibly incorrect message catalog.
cc: "t1.c", 10: 724: , line : warning Cast: converts default int return type to pointer.
The same Code goes without warning in 32 bit compilation mode but aborts in 64 bit.
I am unable to track why this warning is produced in 64 BIT compilation
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 11:28 PM
02-23-2004 11:28 PM
Re: strtok_r 64 BIT HP unix
What compiler are you using? I'm just using the default compiler that comes with a standard HPUX install. I just compiled it fine using gcc though that was on Linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 11:41 PM
02-23-2004 11:41 PM
Re: strtok_r 64 BIT HP unix
ccom: HP92453-01 B.11.11.28212.GP HP C Compiler
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 11:42 PM
02-23-2004 11:42 PM
Re: strtok_r 64 BIT HP unix
cpp.ansi: HP92453-01 B.11.11.06 HP C Preprocessor (ANSI)
ccom: HP92453-01 B.11.11.28212.GP HP C Compiler
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 11:50 PM
02-23-2004 11:50 PM
Re: strtok_r 64 BIT HP unix
If you are running this on a 64 bit machine, try compiling it with no options i.e just "-o"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 11:55 PM
02-23-2004 11:55 PM
Re: strtok_r 64 BIT HP unix
>>
cc: "t1.c", 10: 724: , line : warning Cast: converts default int return type to pointer.
<<
Undoubtly you use the function that is not previously declared to the compiler. It should work even without casting.
try:
cc +DD64 -g -o t1 -D_REENTRANT t1.c
Good luck
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2004 12:00 AM
02-24-2004 12:00 AM
Re: strtok_r 64 BIT HP unix
I tried it with and without the cast. Both worked fine though without the cast produced warnings at compile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2004 12:16 AM
02-24-2004 12:16 AM
Re: strtok_r 64 BIT HP unix
Its working ! Thanks.
I thought REENTRANT option should be used for Multithreading functions.
Since,strtok_r one way is reentrancy even though no multithreaded calls are there ,we should use this option.
Is my understanding correct.
Thanks for help. But I am not able to understand whether this is justified
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2004 01:23 AM
02-24-2004 01:23 AM
Re: strtok_r 64 BIT HP unix
Srinivasan,
I'm glad it's working.
Sometimes analyzing teories is less usefull than simple source checking:
more /usr/include/string.h
[...]
# ifdef _REENTRANT
extern char *strtok_r(char *, const char *, char **);
# ifdef _PTHREADS_DRAFT4
extern int strerror_r(int, char *, int);
# endif /* _PTHREADS_DRAFT4 */
# endif
[...]
And thats it. Not defined = not declared.
Mark,
I'm surprized that it produced warnings, as return value is char * and is assigned to char *, so I cannot see what to warn about. However I have a rule not to argue with facts.
Good luck
Adam