473,224 Members | 1,935 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,224 software developers and data experts.

"does not give a valid preprocessing token"... Why?

Hi All,

I have a piece of code (not written by me) that is failing on compile with
the error:
pasting "xdr_ndmp_connect_open_request" and "," does not
give a valid preprocessing token

The relevant line from the header is:
#define XDR_AND_SIZE(func) (bool_t(*)(XDR*, ...))xdr_##func##,sizeof(func)

Any and all help greatly appreciated.
Nov 14 '05 #1
3 22737
Frodo Baggins <fr************@here.com> scribbled the following:
Hi All, I have a piece of code (not written by me) that is failing on compile with
the error:
pasting "xdr_ndmp_connect_open_request" and "," does not
give a valid preprocessing token The relevant line from the header is:
#define XDR_AND_SIZE(func) (bool_t(*)(XDR*, ...))xdr_##func##,sizeof(func) Any and all help greatly appreciated.


C tokenising doesn't work like you think it does. The , (commma) that
separates function parameters is a token on its own, not part of some
greater token that comprises the entire function invocation.
In other words, your function invocation would read tokenised like this:

(
bool_t
(
*
)
(
XDR
*
,
....
)
)
xdr_func
,
sizeof
(
func
)

The ## preprocessing operator concatenates two pieces of text into one
single token. This makes the invocation read like this:

(
bool_t
(
*
)
(
XDR
*
,
....
)
)
xdr_func,
sizeof
(
func
)

See the difference? You end up with a token saying "xdr_func," (note
the comma) which is not a legal identifier, operator or punctuator.

To fix this, simply replace the second ## with a space.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Make money fast! Don't feed it!"
- Anon
Nov 14 '05 #2
Frodo Baggins <fr************@here.com> writes:
pasting "xdr_ndmp_connect_open_request" and "," does not
give a valid preprocessing token

The relevant line from the header is:
#define XDR_AND_SIZE(func) (bool_t(*)(XDR*, ...))xdr_##func##,sizeof(func)


Remove the second ##. It looks like its inclusion was a mistake.
--
Here's a tip: null pointers don't have to be *dull* pointers!
Nov 14 '05 #3
On Wed, 15 Sep 2004 18:14:31 +0000, Joona I Palaste wrote:
See the difference? You end up with a token saying "xdr_func," (note
the comma) which is not a legal identifier, operator or punctuator.

To fix this, simply replace the second ## with a space.


That was it exactly. Thank you both Joona and Ben. :)
Nov 14 '05 #4

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

Similar topics

4
by: Stephen Oakes | last post by:
I am trying to upload an image to a server, but I get this warning: Warning: imagecreatefromjpeg(): 'filename' is not a valid JPEG file The error occurs when I am trying to create a thumbnail...
1
by: Lauchlan M | last post by:
I get the following error. Apart from the fact that it does not make any grammatical sense, what would be likely to be causing it? The background is that nxCmdDeleteErrorLogItem is a delete...
1
by: Lauchlan M | last post by:
I get the following error. Apart from the fact that it does not make any grammatical sense, what would be likely to be causing it? I have a command component 'nxCmdDeleteErrorLogItem' with the...
2
by: Tom | last post by:
I'm getting this error when I try to pass a structure to a dll. An unhandled exception of type 'System.ArgumentException' occured in Test1.exe Additional Information: Type could not be marshaled...
4
by: lisa | last post by:
I have an XML file that starts like this: <?xml version="1.0" encoding="ISO-8859-1" xmlns:fn="http://www.w3.org/2005/xpath-functions"?> <Authors> <Author> <ID>2</ID>...
9
by: larrybud2002 | last post by:
I've read about this error in this group and others from early 2006 but without any resolution, so I thought I'd bump it up to see if there's a solution. Trying to build a website on ...
2
by: shalong | last post by:
Hi all, VS 2008 is complaining that HttpWebRequest class is not in System.Net namespace I have referenced System.Net and have coded "using System.Net" I think its a setup problem rather than a...
3
by: =?Utf-8?B?Sm9uIEU=?= | last post by:
I have an interface class with maybe eight functions, defined in one workspace and am defining a class in a second workspace that derives from this interface. Unfortunately only 7 of the 8...
5
by: Phacer | last post by:
When trying to compile I get this /main.c:30: error: expected identifier or '(' before '{' token ../main.c:31: error: expected identifier or '(' before 'if' make: *** Error 1 SDL_SysWMinfo...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.