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

How to fix unexpected in macro formal parameter list error?

Hi,
I'm an intern student and my boss told me to do porting
from Linux c to Visual C++.When I built the coding, I found this error "unexpected in macro formal parameter list", here is the coding " #define cache_info(format, msg...) \
do { \
;\
} while (0) " . I don't know what is wrong and what the coding is for . I can't also ask the Linus programmer since he is out. Can someone help me ???
Mar 2 '11 #1
3 7122
donbock
2,426 Expert 2GB
Is it really true that the macro expansion does not refer to the parameters? How odd.

The "..." in the parameter list of the macro definition is suspicious. Search through your code for instances where this macro is called -- how many parameters are passed each time?
Mar 2 '11 #2
I can't find anything which uses cache_info. Some suggested me to put comma before ... , so it no longer shows error but I'm not really sure whether it is right or wrong !!! In fact, I don't understanding anything about those. Thanks !!!
Mar 2 '11 #3
donbock
2,426 Expert 2GB
You could find out if the macro is being used by suppressing its definition. Bracket the macro definition by "#if 0" and "#endif" and then rebuild your program. You should get an error for each time the macro is called.

"..." in the macro definition suggests the author intended for the macro to accept a variable number of parameters. That was a nonstandard compiler feature until the C99 standard was approved. If the program was originally written for a compiler that wasn't C99-compliant, then it had some idiosyncratic syntax for variable macro parameter lists. There would be no reason to expect this syntax to match that of your new compiler. For that matter, many pre-C99 compilers didn't support this feature at all.

Is it really true that the definition of this macro has no instructions within the do-while block?
Mar 2 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: TJRobertsJob | last post by:
Was wondering if someone could help. Over the last month I've been developing a small database application, using Access 2000, for use in a friends shop. Everything was going well until about a...
1
by: Dan | last post by:
I can't figure out this error message. Could someone please help. I have a text file in Notepad with the following 4 fields (Cont, Code, List, and Numb)all of which are single tab delimited, and a...
0
by: mvdkwong | last post by:
I am trying to run a macro that will export a table into a fixed length file (see below). However, when I run it, I get the following error: "Cannot update. Database or object is read-only." I've...
7
by: rudevincy | last post by:
Hello I am new to VBA and I am trying to create this program however I get the run time error 3061 Too few parameter expected_1, what does this mean, my code is: Sub...
0
by: =?Utf-8?B?amtyYW1vczIwMDU=?= | last post by:
Hi, I had received some help earlier in the week with regards to writing a Change Macro for Excel. Now I am getting an error message and I wanted to confirm why. Below is the part of the code...
13
by: mohi | last post by:
hello everyone, i use a function called minor to find the minor of an element of a matrix , i declare it as : float minor(float A,int m,int n,int i,int j);//find the minor in A and define...
1
by: awojciehowski | last post by:
Greetings: I have been working on a database and have found a peculiar error. When I open up my database and choose a form called "add inventory", then click on "view reports" and then,...
5
by: =?GB2312?B?17/HvyBaaHVvLCBRaWFuZw==?= | last post by:
Hi, I would like to have someone comments on what's the best practice defining error codes in C. Here's what I think: solution A: using enum pros: type safe. better for debug (some debugger...
10
sueb
by: sueb | last post by:
I've done a lot of database work, but only scratched the surface with Access. I'm trying to write a macro (executable on-click from a button on a form) that will clear a subset of the current...
4
by: nebula53 | last post by:
Please find the attached Data base When I changed the design of the Main form the macro stopped working properly How can I fix it so when I open my Data base the ( Main form ) open...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.