LinuxQuestions.org
Register a domain and help support LQ
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
 
LinkBack Search this Thread
Old 10-27-2005, 10:34 AM   #1
cigarstub
Member
 
Registered: Sep 2005
Posts: 145

Rep: Reputation: 15
a bug in tls.h


Is it the same:
typedef union song
{
size_t albumNo;
void *artist;
} songName;

AND

typedef union
{
size_t albumNo;
void *artist;
} songName;
Are them the same ??
Please explain what size_t corresponds??
 
Old 10-27-2005, 11:04 AM   #2
naf
Member
 
Registered: Oct 2005
Location: Chicago, USA
Distribution: Slackware & Fedora
Posts: 66

Rep: Reputation: 15
They are the same. The only difference is that the name song is used for the first union and the second union is unnamed. That difference is insignificant because both forms are typdefing the unions to a given type name.

size_t is platform specific, however, most platforms typedef this field as long unsigned integer. On my system, it is defined as:

# 214 "/usr/lib/gcc/x86_64-redhat-linux/4.0.1/include/stddef.h" 3 4
typedef long unsigned int size_t;
 
Old 10-27-2005, 08:14 PM   #3
cigarstub
Member
 
Registered: Sep 2005
Posts: 145

Original Poster
Rep: Reputation: 15
QUOTES
# 214 "/usr/lib/gcc/x86_64-redhat-linux/4.0.1/include/stddef.h" 3 4

cOULD you explain the above ?
 
Old 10-27-2005, 08:48 PM   #4
naf
Member
 
Registered: Oct 2005
Location: Chicago, USA
Distribution: Slackware & Fedora
Posts: 66

Rep: Reputation: 15
That shows what line from which file the given source code was seen.
In this particular case, the definition was in a file called:
/usr/lib/gcc/x86_64-redhat-linux/4.0.1/include/stddef.h
This file is part of the gcc compiler header files in the standard includes. This compiler is called gcc (GNU C Compiler) targeted for code generation on an Athlon64 (x86_64) system and is version 4.0.1.
That line starting with the # mark is the result of only pre-processing the C source file including <stdio.h>. I only extracted the two pertinent lines for you (the full contents is large).

Pre-processing occurs prior to compilation where all those preprocessor directives (lines that start with the # symbol like #include, #if... #endif, #define, etc. ) are interpreted and the source file is converted to a readable source file that the compiler can parse. This phase is done automatically when you compile, but you can usually specify only preprocess to the compiler for debugging purposes or if you write tools to analyze the processed C code.

A little long winded, but I have a feeling you wanted more detail anyway.
 
Old 10-27-2005, 10:08 PM   #5
cigarstub
Member
 
Registered: Sep 2005
Posts: 145

Original Poster
Rep: Reputation: 15
So 3 4 means ?
 
Old 10-28-2005, 09:13 AM   #6
naf
Member
 
Registered: Oct 2005
Location: Chicago, USA
Distribution: Slackware & Fedora
Posts: 66

Rep: Reputation: 15
Quote:
Originally posted by cigarstub
So 3 4 means ?
That is from the GNU preprocessor. They are flags from the preprocessor to the compiler. These are not a standard C compiler flags.

Briefly, it 3 means the following text comes from a system header file, so certain warnings should be suppressed. The 4 means the following text should be treated as being wrapped in an implicit extern "C" block. To be explict, the following lines are the text lines following the # directive upto the next # directive indicating another file.

Check out the doc http://gcc.gnu.org/onlinedocs/cpp/Pr...ocessor-Output for more information.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
installing tls drknow Linux - Newbie 9 07-03-2006 11:46 AM
TLS Relay denied freealx Linux - Software 2 03-15-2005 10:41 AM
Sendmail TLS relay freealx Linux - Networking 1 03-12-2005 04:09 PM
Free86 bug or nVidia bug?? ProtoformX Linux - Software 2 05-12-2004 02:38 AM
SSL vs. TLS X11 Linux - Security 8 12-17-2002 03:39 PM


All times are GMT -5. The time now is 08:06 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration