Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #17932 > unrolled thread
| Started by | janus <emekamicro@gmail.com> |
|---|---|
| First post | 2012-02-25 08:02 -0800 |
| Last post | 2012-02-25 10:18 -0800 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.lang.c
Macro still floating above my head janus <emekamicro@gmail.com> - 2012-02-25 08:02 -0800
Re: Macro still floating above my head Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-02-25 11:26 -0500
Re: Macro still floating above my head China Blue Sea <chine.bleu@yahoo.com> - 2012-02-25 08:47 -0800
Re: Macro still floating above my head 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-25 10:18 -0800
| From | janus <emekamicro@gmail.com> |
|---|---|
| Date | 2012-02-25 08:02 -0800 |
| Subject | Macro still floating above my head |
| Message-ID | <3548629.310.1330185767588.JavaMail.geo-discussion-forums@vbux23> |
Hello All, I would need some to explain the below code. #define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15 I understand "..." as variable arguments. But what is "_x"? Regards, \Janus
[toc] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2012-02-25 11:26 -0500 |
| Message-ID | <jib241$5b3$1@dont-email.me> |
| In reply to | #17932 |
On 2/25/2012 11:02 AM, janus wrote:
> Hello All,
>
> I would need some to explain the below code.
> #define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15
>
> I understand "..." as variable arguments. But what is "_x"?
A name for a macro parameter. The macro is equivalent to
#define RF_ARG16(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, \
p10, p11, p12, p13, p14, p15, ...) p15
or to
#define RF_ARG16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,...) p
In any guise, it looks like a symptom of macro overreach if
not outright macro abuse.
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [next] | [standalone]
| From | China Blue Sea <chine.bleu@yahoo.com> |
|---|---|
| Date | 2012-02-25 08:47 -0800 |
| Message-ID | <chine.bleu-595E4F.08470225022012@news.eternal-september.org> |
| In reply to | #17933 |
In article <jib241$5b3$1@dont-email.me>, Eric Sosman <esosman@ieee-dot-org.invalid> wrote: > On 2/25/2012 11:02 AM, janus wrote: > > Hello All, > > > > I would need some to explain the below code. > > #define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, > > #_13, _14, _15, ...) _15 > > > > I understand "..." as variable arguments. But what is "_x"? > > A name for a macro parameter. The macro is equivalent to > > #define RF_ARG16(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, \ > p10, p11, p12, p13, p14, p15, ...) p15 > > or to > > #define RF_ARG16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,...) p > > In any guise, it looks like a symptom of macro overreach if > not outright macro abuse. Your expansion says no no no, but your parameters say yes yes yes. -- My name Indigo Montoya. | R'lyeh 38o57'6.5''S 102o51'16''E. You flamed my father. | I'm whoever you want me to be. Prepare to be spanked. | Annoying Usenet one post at a time. Stop posting that! | At least I can stay in character.
[toc] | [prev] | [next] | [standalone]
| From | 88888 Dihedral <dihedral88888@googlemail.com> |
|---|---|
| Date | 2012-02-25 10:18 -0800 |
| Message-ID | <26935764.220.1330193923872.JavaMail.geo-discussion-forums@pbeo1> |
| In reply to | #17932 |
在 2012年2月26日星期日UTC+8上午12时02分47秒,janus写道: > Hello All, > > I would need some to explain the below code. > #define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15 > > I understand "..." as variable arguments. But what is "_x"? > > Regards, \Janus 在 2012年2月26日星期日UTC+8上午12时02分47秒,janus写道: > Hello All, > > I would need some to explain the below code. > #define RF_ARG16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15 > > I understand "..." as variable arguments. But what is "_x"? > > Regards, \Janus If the variaied number of arguments in a function somewhat like printf called everywhere, then the stack has to be used a lot. I never call printf with more then 4 variables to show messages.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c
csiph-web