By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,401 Members | 803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,401 IT Pros & Developers. It's quick & easy.

what does this statement mean

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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

P: n/a

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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.