LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-14-2010, 08:58 PM   #16
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940

Quote:
Originally Posted by wje_lq View Post
Happy to enlighten you.... I started invoking its name after another poster, in asking a question, began his question in the name of Allah....I suspect there's a certain amount of unintentional bias here, because nobody seems to be disciplined because of including (Christian) Bible quotations in his signature.
It is nice that you bothered to explain I have seen the threads of both the posters, one of them is our Kenny (the star of /General )
IMHO you are missing a point here.
Writing religious statements is not a problem but writing them on the start of the posts IS, simply because the reader is forced to read them. But if you put those statements in your signature, people can easily ignore it, so what Kenny has done is not against the rules and no one would have complained if the other Muslim poster would have done the same but instead he used to write "In name of Allah" at the beginning of every post of his.

e.g Me: I don't believe in Islam, I am a Hindu girl, but if I ever answered or read his threads I would definitely find it irritating to read about "Allah" all the time and his threads would be ignored by me!!
Quote:
Originally Posted by wje_lq View Post
I raised the issue with the moderator, asking whether we were going to be consistent, and got no answer.
Because you wrote a visitor message to him, perhaps you don't know that no mail notification gets sent for visitor messages and moderator may have easily missed it. Consider sending a PM to Tinkster or XavierP, both of them are very active and friendly too!

Quote:
Originally Posted by wje_lq View Post
So I'm using this greeting to establish a precedent. Maybe they'll discipline me with ten lashes with a wet piece of spaghetti or something.
No offense intended but I personally find that monster statement irritating, (I actually didn't know that it was related to Christianity, so I thought you were trying to make fun of me) I am the OP of this thread so I don't have any choice other than reading that statement every time you post since I need help here, I would have ignored your post had it been the other way round!

How about putting that statement in your signature Try that, and if anyone complains, feel free to discipline me with ten lashes

Last edited by Aquarius_Girl; 12-14-2010 at 09:30 PM. Reason: added statements
 
Old 12-14-2010, 09:01 PM   #17
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by eSelix View Post
Sorry Anisha I second time mistake someone gender.
That Okay I hope Anisha doesn't sound like a man's name

Quote:
Originally Posted by eSelix View Post
I could say the same as ealier
That question was not for you but for sree_ec who had got it wrong in post 5.
 
Old 12-14-2010, 09:24 PM   #18
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by wje_lq View Post
Here's a test, if it's in fact your computer: Change that line in string.h so it says:
Code:
exxtern int strnicmp(const char *, const char *, __kernel_size_t);
That's right. Put an extra x in there. If your code still compiles, then this line was excluded by conditional compilation directives, so the compiler didn't care about that extra x.
There are a lot of string.h files scattered everywhere, the one I modified is highlighted here! and nothing happened and then I modified strcmp fx there too but still the code got compiled properly?? I'll try that again today, Dumb question: How to find which one is currently being used?
Code:
anisha@linux-uitj:~> locate string.h
/opt/kde3/include/dom/dom_string.h
/opt/kde3/include/kdevelop/interfaces/hashedstring.h
/opt/kde3/include/kjs/ustring.h
/opt/qtsdk-2010.05/qt/doc/html/q3cstring.html
/opt/qtsdk-2010.05/qt/doc/html/qconststring.html
/opt/qtsdk-2010.05/qt/doc/html/qdeclarativescriptstring.html
/opt/qtsdk-2010.05/qt/doc/html/qlatin1string.html
/opt/qtsdk-2010.05/qt/doc/html/qml-string.html
/opt/qtsdk-2010.05/qt/doc/html/qscriptstring.html
/opt/qtsdk-2010.05/qt/doc/html/qstring.html
/opt/qtsdk-2010.05/qt/include/Qt/q3cstring.h
/opt/qtsdk-2010.05/qt/include/Qt/qdeclarativescriptstring.h
/opt/qtsdk-2010.05/qt/include/Qt/qscriptstring.h
/opt/qtsdk-2010.05/qt/include/Qt/qstring.h
/opt/qtsdk-2010.05/qt/include/Qt3Support/q3cstring.h
/opt/qtsdk-2010.05/qt/include/QtCore/qstring.h
/opt/qtsdk-2010.05/qt/include/QtDeclarative/qdeclarativescriptstring.h
/opt/qtsdk-2010.05/qt/include/QtScript/qscriptstring.h
/opt/qtsdk-2010.05/qt/src/corelib/tools/qstring.h
/opt/qtsdk-2010.05/qt/src/declarative/qml/qdeclarativescriptstring.h
/opt/qtsdk-2010.05/qt/src/qt3support/tools/q3cstring.h
/opt/qtsdk-2010.05/qt/src/script/api/qscriptstring.h
/usr/include/bits/string.h
/usr/include/boost/algorithm/string.hpp
/usr/include/boost/exception/to_string.hpp
/usr/include/boost/interprocess/containers/container/string.hpp
/usr/include/boost/interprocess/containers/string.hpp
/usr/include/boost/serialization/string.hpp
/usr/include/boost/spirit/home/karma/string.hpp
/usr/include/boost/spirit/home/qi/string.hpp
/usr/include/boost/spirit/include/karma_string.hpp
/usr/include/boost/spirit/include/qi_string.hpp
/usr/include/boost/test/utils/basic_cstring/basic_cstring.hpp
/usr/include/boost/typeof/std/string.hpp
/usr/include/boost/wave/util/flex_string.hpp
/usr/include/c++/4.4/bits/basic_string.h
/usr/include/c++/4.4/ext/vstring.h
/usr/include/dom/dom_string.h
/usr/include/dyn-string.h
/usr/include/glib-2.0/glib/gstring.h
/usr/include/glibmm-2.4/glibmm/ustring.h
/usr/include/jasper/jas_string.h
/usr/include/klocalizedstring.h
/usr/include/libcroco-0.6/libcroco/cr-string.h
/usr/include/libgda-3.0/libgda/handlers/gda-handler-string.h
/usr/include/libgda-4.0/libgda/handlers/gda-handler-string.h
/usr/include/libgnomedb-4.0/libgnomedb/data-entries/gnome-db-entry-string.h
/usr/include/libxml2/libxml/xmlstring.h
/usr/include/linux/netfilter/xt_string.h
/usr/include/linux/netfilter_ipv4/ipt_string.h
/usr/include/linux/string.h
/usr/include/mysql/m_string.h
/usr/include/neon/ne_string.h
/usr/include/orbit-2.0/orbit/orb-core/corba-string.h
/usr/include/pangomm-1.4/pangomm/glyphstring.h
/usr/include/Qt/q3cstring.h
/usr/include/Qt/qscriptstring.h
/usr/include/Qt/qstring.h
/usr/include/Qt3Support/q3cstring.h
/usr/include/QtCore/qstring.h
/usr/include/QtScript/qscriptstring.h
/usr/include/string.h
/usr/include/wv2/ustring.h
/usr/include/wvstreams/verstring.h
/usr/include/wvstreams/wvstdstring.h
/usr/include/wvstreams/wvstring.h
/usr/include/wvstreams/wvtclstring.h
/usr/include/wvstreams/wvverstring.h
/usr/include/xulrunner-1.9.1.4/unstable/nsDependentSubstring.h
/usr/include/xulrunner-1.9.1.4/unstable/nsSubstring.h
/usr/include/xulrunner-1.9.1.4/unstable/nsTDependentSubstring.h
/usr/include/xulrunner-1.9.1.4/unstable/nsTSubstring.h
/usr/lib/qt3/doc/html/qconststring.html
/usr/lib/qt3/doc/html/qcstring.html
/usr/lib/qt3/doc/html/qstring.html
/usr/lib/qt3/include/qcstring.h
/usr/lib/qt3/include/qstring.h
/usr/local/include/wx-2.9/wx/string.h
/usr/local/include/wx-2.9/wx/ustring.h
/usr/share/doc/glibmm-2.4/reference/html/classGlib_1_1ustring.html
/usr/share/doc/packages/libqt4/html/q3cstring.html
/usr/share/doc/packages/libqt4/html/qconststring.html
/usr/share/doc/packages/libqt4/html/qlatin1string.html
/usr/share/doc/packages/libqt4/html/qscriptstring.html
/usr/share/doc/packages/libqt4/html/qstring.html
/usr/share/gettext/intl/hash-string.h
/usr/share/gnome/help/gnome-dev-info/C/gnome-string.html
/usr/share/man/man0p/string.h.0p.gz
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/doc/lib/copy-string.html
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/doc/lib/list-2-string.html
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/doc/lib/node-2-string.html
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/doc/lib/pad-string.html
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/doc/lib/repl-substring.html
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/doc/lib/trim-string.html
/usr/share/sgml/docbook/dsssl-stylesheets-1.79/doc/lib/url-encode-string.html
/usr/share/systemtap/runtime/string.h
/usr/share/xml/docbook/stylesheet/nwalsh/1.75.2/doc/common/template.pad-string.html
/usr/share/xml/docbook/stylesheet/nwalsh/1.75.2/doc/lib/comment-escape-string.html
/usr/share/xml/docbook/stylesheet/nwalsh/1.75.2/doc/lib/copy-string.html
/usr/src/linux-2.6.31.5-0.1-obj/x86_64/debug/include/config/netfilter/xt/match/string.h
/usr/src/linux-2.6.31.5-0.1-obj/x86_64/default/include/config/netfilter/xt/match/string.h
/usr/src/linux-2.6.31.5-0.1-obj/x86_64/desktop/include/config/netfilter/xt/match/string.h
/usr/src/linux-2.6.31.5-0.1-obj/x86_64/xen/include/config/netfilter/xt/match/string.h
/usr/src/linux-2.6.31.5-0.1/arch/alpha/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/arm/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/avr32/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/blackfin/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/cris/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/frv/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/h8300/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/ia64/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/m32r/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/m68k/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/microblaze/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/mips/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/mn10300/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/parisc/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/powerpc/boot/string.h
/usr/src/linux-2.6.31.5-0.1/arch/powerpc/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/s390/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/sh/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/sparc/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/x86/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/arch/xtensa/include/asm/string.h
/usr/src/linux-2.6.31.5-0.1/include/asm-generic/string.h
/usr/src/linux-2.6.31.5-0.1/include/linux/netfilter/xt_string.h
/usr/src/linux-2.6.31.5-0.1/include/linux/netfilter_ipv4/ipt_string.h
/usr/src/linux-2.6.31.5-0.1/include/linux/string.h
/usr/src/linux-2.6.31.5-0.1/include/linux/string.h~
/usr/src/linux-2.6.31.5-0.1/security/selinux/include/av_perm_to_string.h
/usr/src/linux-2.6.31.5-0.1/security/selinux/include/class_to_string.h
/usr/src/linux-2.6.31.5-0.1/security/selinux/include/common_perm_to_string.h
/usr/src/linux-2.6.31.5-0.1/security/selinux/include/initial_sid_to_string.h
/usr/src/linux-2.6.31.5-0.1/tools/perf/util/string.h
 
Old 12-14-2010, 11:01 PM   #19
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 179Reputation: 179
Quote:
Originally Posted by anishakaul View Post
There are a lot of string.h files scattered everywhere, the one I modified is highlighted here! and nothing happened and then I modified strcmp fx there too but still the code got compiled properly??
Remember, these lines at the beginning of the file:
Code:
/* We don't want strings.h stuff being used by user stuff by accident */

#ifndef __KERNEL__
#include <string.h>
#else
... cause most of the rest of the file to be ignored. That's why your code compiled the same even after you damaged part of the file for test purposes.

Beyond that, could it be that this file is not string.h, but instead strings.h? The comment at the beginning of it seems to imply so.

Excuse me while I go have spaghetti for dinner. :)
 
Old 12-15-2010, 12:56 AM   #20
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
You will find that the posix commands generally have man pages, which will get you going pretty quickly.

For example (in OpenSUSE) man strcmp gets hits, while man stricmp doesn't.

The string library that is getting used will be the one you include, or it will be included from an include that you included. If you use grep, you will learn a lot about where your function is defined.

For instance, working from /usr/include, grep strcmp * will return a couple of lines, only one of which defines strcmp while grep -r strcmp * will take you through the entire directory tree and give lots of other returns.

Trying that with stricmp returns...nothing.

Also, the flying spaghetti monster isn't associated with christianity. It is intended to mock christianity, specifically with regard to the insistence of some christian fundamentalists that "creationism" (a literal interpretation of the bible, which states that god created the universe in 6 days) is science just like evolution, and should be taught in science class just as evolution is taught.

Last edited by jiml8; 12-15-2010 at 12:59 AM.
 
1 members found this post helpful.
Old 12-15-2010, 06:41 AM   #21
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 179Reputation: 179
Quote:
Originally Posted by jiml8 View Post
For instance, working from /usr/include, grep strcmp * will return a couple of lines, only one of which defines strcmp while grep -r strcmp * will take you through the entire directory tree and give lots of other returns.

Trying that with stricmp returns...nothing.
In debian, it depends on which packages you have installed:
Code:
wally:~$ grep -lr stricmp /usr/include 2> /dev/null
/usr/include/opencv/cvvidsurv.hpp
/usr/include/octave-3.0.1/octave/config.h
/usr/include/octave/config.h
/usr/include/php5/ext/date/lib/timelib.h
/usr/include/wx-2.6/wx/string.h
/usr/include/wx-2.6/wx/wxchar.h
/usr/include/qt4/Qt3Support/q3strlist.h
/usr/include/qt4/Qt3Support/q3strvec.h
/usr/include/qt4/Qt/q3strlist.h
/usr/include/qt4/Qt/q3strvec.h
/usr/include/qt4/Qt/qbytearray.h
/usr/include/qt4/QtCore/qbytearray.h
wally:~$
 
Old 12-15-2010, 01:50 PM   #22
sree_ec
Member
 
Registered: Sep 2010
Location: world
Distribution: Ubuntu 12.04LTS
Posts: 76

Rep: Reputation: 5
Quote:
Originally Posted by anisha Kaul View Post
There are a lot of string.h files scattered everywhere, the one I modified is highlighted here! and nothing happened and then I modified strcmp fx there too but still the code got compiled properly?? I'll try that again today, Dumb question: How to find which one is currently being used?
You can have a look at the preprocessed file to see which file is getting included
Instead of making the exe with gcc, try this command instead to see the preprocessed output. I used cpp[c pre processor] command here

Code:
#cpp test.c > test.cpp
Search inside this test.cpp to see which is getting included..
 
2 members found this post helpful.
Old 12-21-2010, 05:13 AM   #23
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by wje_lq View Post
I suspect there's a certain amount of unintentional bias here, because nobody seems to be disciplined because of including (Christian) Bible quotations in his signature.
In the name of the Flying Spaghetti Monster, here something for you in addition to my "Post 16":
http://www.linuxquestions.org/questi...ontent-851530/

Last edited by Aquarius_Girl; 12-21-2010 at 05:15 AM.
 
1 members found this post helpful.
Old 12-21-2010, 05:42 AM   #24
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 179Reputation: 179
Cool. Thank you. You may have noticed that after that meal of spaghetti that I mentioned earlier, I have reformed my ways. :)

By the way, what did you conclude from the exploration of the original question of this thread?
 
Old 12-21-2010, 05:53 AM   #25
sree_ec
Member
 
Registered: Sep 2010
Location: world
Distribution: Ubuntu 12.04LTS
Posts: 76

Rep: Reputation: 5
Quote:
Originally Posted by wje_lq View Post
Cool. Thank you. You may have noticed that after that meal of spaghetti that I mentioned earlier, I have reformed my ways. :)

By the way, what did you conclude from the exploration of the original question of this thread?
Adding to this,

P.S.
After offering help, LQ members appreciate a *response* from the original poster,
Not replying is considered rude!
 
Old 12-21-2010, 11:57 AM   #26
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
All includes for normal user-space C programs come from /usr/include

Any include files from anywhere else are not covered by POSIX / GNU C, generally speaking. When you use an include file from, say, kernel - you better be writing a kernel module. If not, the linker might not find symbols you're trying to use (such as stricmp, in this case). When you write user-space programs, you're linked against the C library. When you write kernel code, you're linked against the kernel. The two are not inter-mingled (although, for convenience, many kernel utility functions share a name with their posix counterparts).

I'd suggest reading up on linkers, loaders, and libraries. Google will help with that.
 
1 members found this post helpful.
Old 12-26-2010, 01:23 AM   #27
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Code:
#cpp test.c > test.cpp
That was helpful, I tried that and it was visible that the /usr/include/string.h was getting included.

In post 18, I had randomly modified a string.h without knowing whether it was getting included or not, that's why it didn't have any effect on the compilation of the program!

and I checked that function "stricmp" was no where in the string.h, through the grep way mentioned by Jim.

Besides there are some other functions too (I don't remember their names right now) which do not have "CONFIRMING TO" section in their man pages! I wonder what is the reason behind the discrimination of these functions??

Thanks to ALL the posters of this thread for giving enlightening inputs!
 
Old 01-14-2011, 02:34 AM   #28
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by orgcandman View Post
When you use an include file from, say, kernel - you better be writing a kernel module.
This thread was marked SOLVED a long back ago, and today I was compiling a hello world kernel module and that resulted in the errors w.r.t some string.h files??? WTF? Looking carefully at the path of the string.h in the error message, I noticed it to be "/usr/src/linux-2.6.31.5-0.1/include/linux/string.h", Aaah, this is the same file I modified in Post number: 18 as a test but didn't revert back
 
  


Reply

Tags
stricmp



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
Undefined reference, why? george_mercury Programming 4 05-07-2009 12:15 AM
undefined reference to.... crapodino Programming 1 01-13-2008 07:05 PM
undefined reference to... dimah Programming 3 12-27-2006 09:57 AM
undefined reference vkmgeek Programming 1 05-11-2006 06:37 AM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 03:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:33 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