LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-14-2005, 11:22 PM   #1
dogbird
Member
 
Registered: Nov 2004
Location: oklahoma
Distribution: slackware 9.0
Posts: 98

Rep: Reputation: 15
A problem with the documentation in 9.0


I have been complaining about lib problems. It turns out that the libs are basically ok, but the documentation is incomplete. I was trying to get fscanf and sscanf to work, the man page only gave me the desc and target but did not give any information about how arguments are used. This extends into the problem of isdigit. Since isdigit is a wrapper around a wrapper around a wrapper It is not possible to debug the call.

related to this is the definition of an int. Since I have a **char I should be able to index the characters of the token. There is no configuration that I can determine that will not cause a segerror in the calll. I discovered I cannot refer to **token as *token[0]. It does not work at all and generates a segerror. I am annoyed that the compiler confuses int16 with char8. I dont know how to tweak this to work. I need to write my own isdigit. and I need to create a substring function. there is no substring definition in the libraries I have. It is not in the man page and it is not in the info.

josephus
 
Old 11-15-2005, 03:34 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
there is no substring definition in the libraries I have.
Try :
Code:
char *strstr(const char *haystack, const char *needle);
read function doc with : man strstr

For your segerror, try to post the relevant part of your code that generate
the error, maybe at a more appropriate forum, though like the programming
section of this site
 
Old 11-15-2005, 08:57 PM   #3
dogbird
Member
 
Registered: Nov 2004
Location: oklahoma
Distribution: slackware 9.0
Posts: 98

Original Poster
Rep: Reputation: 15
The problem seems to be an inconsistency in GCC. Some times it works and some times it fails and there is not enought information to determine if I am at fault ro the compliler is goofing off. I could not find any fault with the code to select indexing. It kept failing with segerror. i wrote a different peice of code and it worked. I cant figure out what is happening.

The code is now working. GCC passes in a char and in the routine thinks that ch is an int. sigh. I stopped trying to print it and it started working. So a char on the stack is not a char but an int. It iwill not print with %s GCC changed the data type. It does not say it does this, but cllearly this is what GCC did. Debuging is hard when I dont expect tokens to be constant.

It is the incompleteness of C that causes me to lose it. The documentation for strstr I have is that you pass in a char and it returns a pointer to that location. this is not a substring function. May be your man pages are right , and mine is just wroing. a substring should return the substring as a separate string.

If I complain and jump up and down and sleep on it. I will think of some fiix and it works. On to the next fuzzy problem.
] Thank you for the suggestion.
josephus
 
Old 11-15-2005, 11:25 PM   #4
LiNuCe
Member
 
Registered: Apr 2004
Location: France
Distribution: Slackware Linux 10.2
Posts: 119

Rep: Reputation: 15
I don't know what program you are trying to write, but you might consider using GLib 2.x to manipulate data structures such as arrays, simple or double linked lists, strings... GLib 2.x has a up-to-date, complete documentation, it is quite portable and it provides a set of commonly used utility functions which can save a lot of time. I use it and I'm really satisfied.

--
LiNuCe
 
Old 11-16-2005, 03:04 AM   #5
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
You also might want to consider notifying a moderator and having this thread moved to the programming section of LQ. I imagine you'd have more luck there, even though many Slackers are indeed programmers

--Shade
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
X Documentation ? Ikebo Programming 6 10-02-2004 09:02 PM
Documentation For RH 9.0 Crotch Linux - Newbie 2 04-25-2004 05:42 PM
documentation porous Slackware 4 10-27-2003 09:34 PM
need documentation kroll Linux - Networking 1 08-21-2002 02:29 AM
Too much Documentation rhuarc Linux - General 7 01-03-2002 09:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration