473,804 Members | 2,119 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error: expected ')' before '*' token -- What is this ?

I am trying to write a simple libspf2 plugin code for my postfix
( milter)
I am getting this unhelpful error message when I try to compile

gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
In file included from mfunc.c:1:
mfunc.c:42: error: expected ')' before '*' token
make: *** [mfunc.o] Error 1

my mfunc.c has on the line 42
-----------------------
.. . . . .
SPF_result_t spfcheck_s(SPF_ request_t *ecm_spf_reques t, char* ip,
char* helo, char* sender) {
SPF_response_t *spf_response = NULL;
SPF_result_t t;
SPF_request_set _ipv4_str( ecm_spf_request , ip );
SPF_request_set _helo_dom( ecm_spf_request , helo );
SPF_request_set _env_from( ecm_spf_request , sender );
SPF_request_que ry_mailfrom(ecm _spf_request, &spf_respons e);
t = SPF_response_re sult(spf_respon se);
SPF_response_fr ee(spf_response );
return t;
}

.. . . . .


So what could be the error ?
Thanks
Ram

PS:
Note to Spammers: Go ahead , send me spam
ra*@netcore.co. in
http://ecm.netcore.co.in/spamtrap.html

Jul 31 '07
21 35546
Ram Prasad <ra**********@g mail.comwrites:
I am trying to write a simple libspf2 plugin code for my postfix
( milter)
I am getting this unhelpful error message when I try to compile

gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
In file included from mfunc.c:1:
mfunc.c:42: error: expected ')' before '*' token
make: *** [mfunc.o] Error 1

my mfunc.c has on the line 42
-----------------------
. . . . .
SPF_result_t spfcheck_s(SPF_ request_t *ecm_spf_reques t, char* ip,
char* helo, char* sender) {
SPF_response_t *spf_response = NULL;
SPF_result_t t;
SPF_request_set _ipv4_str( ecm_spf_request , ip );
SPF_request_set _helo_dom( ecm_spf_request , helo );
SPF_request_set _env_from( ecm_spf_request , sender );
SPF_request_que ry_mailfrom(ecm _spf_request, &spf_respons e);
t = SPF_response_re sult(spf_respon se);
SPF_response_fr ee(spf_response );
return t;
}
Typedef names are treated rather oddly in C. Within the compiler, a
typedef name, once it's declared, effectively becomes a keyword rather
than an ordinary identifier. This means that errors with typedef
names can cause bizarre-looking syntax error messages rather than the
"undeclared identifier" message you might expect.

Historical digression:
Early versions of C (before K&R1) didn't have 'typedef', and all
type names were defined by special syntax, not by single
identifiers. 'int', 'double', and so forth are all keywords,
arrays and pointers use special punctuators '[]' and '*',
structure types require a 'struct' keyword, and so forth. When
typedefs were added later on, they had to fit into that model,
which is why they behave so oddly. This can be surprising if
you're accustomed to other languages in which simple identifiers
commonly are used as type names.

For example, here's a small C translation unit with an obvious error:

typedef int my_type;
mytype x;

And here's what gcc has to say about it:

c.c:2: error: parse error before "x"
c.c:2: warning: data definition has no type or storage class

Since "mytype" hasn't been declared as a typedef, the compiler doesn't
even try to guess that it might be a type name, so it throws up its
hands and just fails to parse the declaration. (Possibly it could be
smarter about this, but apparently it isn't.)

I see no obvious errors in the code you posted *assuming* that
SPF_result_t and SPF_request_t have been declared as typedef names.
So, since the compiler is reporting a syntax error, it's likely that
either SPF_result_t or SPF_request_t is *not* declared as a typedef
name, or that neither is.

To test this, try temporarily adding a couple of dummy declarations
above your function definition:

SPF_result_t dummy1;
SPF_request_t dummy2;

and recompile. If I'm right, your compiler will report an equally
confusing syntax error message on one of those lines. Since syntax
errors can cause the compiler to quit trying to process the rest of
the file, try them one at a time. Once you've done that, your job is
to dig into all your nested include files and figure out *why* it's
not declared. Perhaps you haven't included the right header, or
you've misspelled the type name, or the typedef declaration is
excluded by a #if or #ifdef directive. Since the headers you're using
aren't part of the C standard, we can't help you with that.

Seeing the output of the preprocessor could be useful, but beware that
it's going to be very large, since all your headers and macros will be
expanded. gcc uses the "-E" option for this. If you know where your
compiler looks for header files, you might also try searching there
for "SPF_result _t" and/or "SPF_request_t" .

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jul 31 '07 #21
Ram Prasad wrote:
[...]
mfunc.c:42: error: expected ')' before '*' token
[...]

Life imitates art?

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer .h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th***** ********@gmail. com>

Jul 31 '07 #22

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

Similar topics

5
5692
by: cranium.2003 | last post by:
hi, Here is my code #include <iostream.h> int main() { cout <<"HI"; return 0; } and using following command to compile a C++ program g++ ex1.cpp -o ex1
4
2118
by: Gary Wessle | last post by:
Hi I have been trying to find out the reason for this error for an 1hr, please look at it for me. thanks **************** error **************** $ make; ./proj g++ -gdwarf-2 -c -o gen_data.o gen_data.cpp
9
9572
by: Trent | last post by:
Here is the error while using Visual Studio 2005 Error 1 error LNK2019: unresolved external symbol "void __cdecl print(int,int,int,int,int,int,int,int)" (?print@@YAXHHHHHHHH@Z) referenced in function _main assign2.obj Thanks a lot ! Here is the code:
4
10201
by: nickyeng | last post by:
i calling this piece of java code in jsp : List<Customer> list = Customer.listby_page(currentRs); ... ... then it gives me the following error:
2
3101
by: brasewel | last post by:
Hi guys, I'm getting an error i cannot figure. Here is my code Header file ------------------------------------------------------------------------------------------- #ifndef Clock_H #define Clock_H #include <vector> #include <list>
5
7980
by: amitmool | last post by:
hi, i have used the queue library file and try to use the template as template <class QueueItem> queue <QueueItem>::~queue() // line 25 { } template <class QueueItem> void queue<QueueItem>::push(const QueueItem& entry) // line 42
1
2821
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I incorporate the same logic within my simulation, the class that implements the functor logic has problems compiling. I get the following errors: -- Building myTest.cpp --
2
1873
by: Latina | last post by:
Hi, I am doing a program using overloded operators but I am getting some error, Can some one help please. Here is my code: #include<iostream> #include<string.h> #include<cctype> using namespace std;
2
8171
by: kya2 | last post by:
I am not able to create following store procedure. CREATE PROCEDURE DBSAMBA.InsertDeleteBatch(OUT norows INT ) RESULT SETS 1 LANGUAGE SQL BEGIN part1 DECLARE TOTAL_LEFT INT DEFAULT 0; SELECT COUNT(*)INTO TOTAL_LEFT FROM DBSAMBA.REPORTEDTRANSACTION_S; WHILE (TOTAL_LEFT > 0) DO
6
14731
by: samsneelam | last post by:
Hi.. This is samuel, while doing a program, i encountered this problem.. Let me give you clarity regarding my prob.. I am having two files .. one is mpcplib.h it contains the follwing declerations.... #include <queue> #include <vector> #include <string> class database { queue<delayTP> delayThrouput;
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10600
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10352
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9175
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.