473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

what does this statement mean

Hello
This is raghu. And I want to know about the meaning of the statement
given below
log_txt( __FILE__, __LINE__, ##argList);
in above statement what does FILE ,LINE ##argList mean. I want to know
about is it possiable to send arguments like that.
Thanking you in advance

Nov 29 '06 #1
6 2109
raghu wrote:
Hello
This is raghu. And I want to know about the meaning of the statement
given below
log_txt( __FILE__, __LINE__, ##argList);
in above statement what does FILE ,LINE ##argList mean. I want to know
about is it possiable to send arguments like that.
Look __FILE__, __LINE__ and ## up in K&R. It's all explained clearly there.

--
Ian Collins.
Nov 29 '06 #2

Ian Collins wrote:
raghu wrote:
Hello
This is raghu. And I want to know about the meaning of the statement
given below
log_txt( __FILE__, __LINE__, ##argList);
in above statement what does FILE ,LINE ##argList mean. I want to know
about is it possiable to send arguments like that.
Look __FILE__, __LINE__ and ## up in K&R. It's all explained clearly there.
maybe I'm talking out of my ass, but I always thought that using ', ##'
(to suppress the
comma when the last argument is void) is a GCC extension, and not K&R
or standard C.

Nov 29 '06 #3
Racaille said:
>
Ian Collins wrote:
>raghu wrote:
Hello
This is raghu. And I want to know about the meaning of the statement
given below
log_txt( __FILE__, __LINE__, ##argList);
in above statement what does FILE ,LINE ##argList mean. I want to know
about is it possiable to send arguments like that.
Look __FILE__, __LINE__ and ## up in K&R. It's all explained clearly
there.

maybe I'm talking out of my ass, but I always thought that using ', ##'
(to suppress the
comma when the last argument is void) is a GCC extension, and not K&R
or standard C.
## is standard C preprocessor syntax for token-pasting. Its use outside a
macro definition (or of course a comment, string literal, etc) is simply an
error.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Nov 29 '06 #4
2006-11-29 <rM********************@bt.com>,
Richard Heathfield wrote:
Racaille said:
>>
Ian Collins wrote:
>>raghu wrote:
Hello
This is raghu. And I want to know about the meaning of the statement
given below
log_txt( __FILE__, __LINE__, ##argList);
in above statement what does FILE ,LINE ##argList mean. I want to know
about is it possiable to send arguments like that.

Look __FILE__, __LINE__ and ## up in K&R. It's all explained clearly
there.

maybe I'm talking out of my ass, but I always thought that using ', ##'
(to suppress the
comma when the last argument is void) is a GCC extension, and not K&R
or standard C.

## is standard C preprocessor syntax for token-pasting. Its use outside a
macro definition (or of course a comment, string literal, etc) is simply an
error.
GCC does assign it special meaning within variadic macro definitions
where the token before it is the comma and the token after it is the
name of the variadic argument list (gcc variadic macros can have that be
somthing other than __VA_LIST__)

This is all off-topic, of course, but still better than trying to
explain it in a "standard" context when it's clearly a non-standard
usage.
Nov 29 '06 #5

Richard Heathfield wrote:
## is standard C preprocessor syntax for token-pasting. Its use outside a
macro definition (or of course a comment, string literal, etc) is simply an
error.
OK, is this usage of '##' standard c99 ?

--
#define COCO(a, ...) a, ## __VA_ARGS__
int
main(void)
{
return COCO(0);
}
--

my impression was that no, it isn't. But I may be wrong. That's why I
asked.

Nov 29 '06 #6
"Racaille" <0x********@gmail.comwrote:
>
Richard Heathfield wrote:
## is standard C preprocessor syntax for token-pasting. Its use outside a
macro definition (or of course a comment, string literal, etc) is simply an
error.

OK, is this usage of '##' standard c99 ?

#define COCO(a, ...) a, ## __VA_ARGS__
No. It's Ganuck.

Richard
Nov 29 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
24
by: David Mathog | last post by:
If this: int i,sum; int *array; for(sum=0, i=0; i<len; i++){ sum += array; } is converted to this (never mind why for the moment):
86
by: Randy Yates | last post by:
In Harbison and Steele's text (fourth edition, p.111) it is stated, The C language does not specify the range of integers that the integral types will represent, except ot say that type int may...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
4
by: riceyeh | last post by:
Hi, When reading the source code of dojo, it uses the following statement quite often. What does it mean? What I do not understand is it has a function definition enclosed in a pair of parenthesis...
18
by: raghu | last post by:
hello, Iam going through a document contianing C tricks .In it they used the statement in many places i didn't understand can u please tell me the meaning and how the compiler compiles it and runs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.