473,406 Members | 2,954 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,406 software developers and data experts.

Self referencing function prototype typedef

Hello,

Couldn't find reference to this - apologies if that's cuz attempting
it is the mark of an ignominous numpty.

typedef int (FN_t)(char *, FN_t **);

I'm on VMS doing this, tho that shouldn't matter I spose. Here's the
error I get:

.............................^
%CC-E-TYPNOTFOUND, In this declaration, no typedef with the name
"FN_t" occurs in any accessible scope.
at line number 1 in file $1$DGA1:[DENNIS.DEV]FNARG.C;1

I've got a recursive function with a callout function as a parameter,
depending on the flow, the callout function needs to be changed for
the inner call. Do I really have to have 2 function pointers as
arguments to pull this off?

If I do something like this:

typedef int (*FN_1t)(char *, void *);
typedef int (*FN_t)(char *, FN_1t **);

it'll work I spose but it's kinda ugly.
Thanks for any help...

Fatz.

Jul 18 '07 #1
2 3257
Fatz wrote On 07/18/07 11:21,:
Hello,

Couldn't find reference to this - apologies if that's cuz attempting
it is the mark of an ignominous numpty.

typedef int (FN_t)(char *, FN_t **);

I'm on VMS doing this, tho that shouldn't matter I spose. Here's the
error I get:

............................^
%CC-E-TYPNOTFOUND, In this declaration, no typedef with the name
"FN_t" occurs in any accessible scope.
at line number 1 in file $1$DGA1:[DENNIS.DEV]FNARG.C;1

I've got a recursive function with a callout function as a parameter,
depending on the flow, the callout function needs to be changed for
the inner call. Do I really have to have 2 function pointers as
arguments to pull this off?

If I do something like this:

typedef int (*FN_1t)(char *, void *);
typedef int (*FN_t)(char *, FN_1t **);

it'll work I spose but it's kinda ugly.
See Question 1.22 in the comp.lang.c Frequently
Asked Questions (FAQ) list, <http://www.c-faq.com/>.

--
Er*********@sun.com

Jul 18 '07 #2
Eric Sosman <Er*********@sun.comwrote:
See Question 1.22 in the comp.lang.c Frequently
Asked Questions (FAQ) list, <http://www.c-faq.com/>.
The FAQ doesn't give a reason for omitting the keyword 'void' from the
empty parameter lists.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Jul 19 '07 #3

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

Similar topics

3
by: jimjim | last post by:
Hello, My question concerns as to how a pointer is passed by reference as a function argument. The following is from code taken from the MICO implementation of the CORBA specification. in...
1
by: Greg Phillips | last post by:
Hello everyone, I have read the section on templates in The C++ Programming Language 3rd edition 3 times over the last 4 days. Still I am stumped. I'll explain a bit about what I am doing...
9
by: Andy Lomax | last post by:
gcc 3.3 allowed a typedef for a function pointer to contain default argument specifications; for example: typedef int (*foo) (int, int, int=0, bar=0); However, it turns out that this is...
28
by: Michael B. | last post by:
I tend to use rather descriptive names for parameters, so the old style of declaration appeals to me, as I can keep a declaration within 80 chars: void * newKlElem...
1
by: john | last post by:
Relatively new to C coding, so any help would greatly be appreciated. I'm having problems try to return my string array from my parsing function. When I do a printf I am getting the correct value...
8
by: J Krugman | last post by:
My compiler complains if I do something like this typedef struct { node *next; } node; but it's OK with typedef struct superfluous_identifier { superfluous_identifier *next;
6
by: Graham Lee | last post by:
Given a typedef like this: typedef double LoadsOfArgs(double arg1, double arg2, double arg3, double arg4); I can *declare* a function using the typedef: LoadsOfArgs geoMean; int...
3
by: Beta What | last post by:
Hello, I have a question about casting a function pointer. Say I want to make a generic module (say some ADT implementation) that requires a function pointer from the 'actual/other modules'...
16
by: hzmonte | last post by:
Correct me if I am wrong, declaring formal parameters of functions as const, if they should not be/is not changed, has 2 benefits; 1. It tells the program that calls this function that the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.