Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle '(void)' in function typedefs. #51

Closed
ascherer opened this issue May 15, 2024 · 1 comment
Closed

Handle '(void)' in function typedefs. #51

ascherer opened this issue May 15, 2024 · 1 comment
Labels

Comments

@ascherer
Copy link
Owner

ascherer commented May 15, 2024

MWE

For whatever reason, tostring_func is recognized as a type (bold), while print_func is not (italic).

@* Pointer-to-function types.

@s MP int
@s mp_number int

@c @2
typedef void (*print_func) (MP mp, mp_number A);

@ @c
typedef char * (*tostring_func) (MP mp, mp_number A);

@* Index.

Debug output

Tracing after l. 9:
@ 
109:*typedef exp ( +ubinop?+ exp...
104: typedef*exp ( +ubinop+ exp ) (...
18: typedef*exp ( +exp+ ) (...
11:*typedef exp +exp+ (...
10:*typedef +exp+ ( raw...
110:*typedef +exp+ ( int exp +,+ raw...
27: typedef +exp+*( -decl_head- exp +,+ raw...
35: typedef +exp+*( -decl_head- +,+ raw...
14: typedef*+exp+ -(+ raw...
110:*typedef +exp+ -(+ int exp ) ;...
27: typedef +exp+*-(+ -decl_head- exp ) ;...
35: typedef +exp+*-(+ -decl_head- ) ;...
13:*typedef +exp+ -cast- ;...
0: typedef*+exp+ -cast- -;-
10:*typedef +exp- -;-
117:*-typedef- -;-
119:*-decl-
Tracing after l. 12:
@*
110:*typedef int +ubinop?+ ( +ubinop?+...
116:*-typedef- +ubinop?+ ( +ubinop?+...
104:*-typedef- +ubinop+ ( +ubinop?+ exp...
104: -typedef-*+ubinop+ ( +ubinop+ exp ) (...
18: -typedef-*+ubinop+ ( +exp+ ) (...
11:*-typedef- +ubinop+ +exp+ (...
18:*-typedef- +exp+ ( raw...
110:*-typedef- +exp+ ( int exp +,+ raw...
27: -typedef- +exp+*( -decl_head- exp +,+ raw...
35: -typedef- +exp+*( -decl_head- +,+ raw...
14: -typedef-*+exp+ -(+ raw...
110:*-typedef- +exp+ -(+ int exp ) ;...
27: -typedef- +exp+*-(+ -decl_head- exp ) ;...
35: -typedef- +exp+*-(+ -decl_head- ) ;...
13:*-typedef- +exp+ -cast- ;...
0: -typedef-*+exp+ -cast- -;-
10:*-typedef- +exp- -;-
117:*-typedef- -;-
119:*-decl-

(Did you see the warning message above?)

Woven output

func_typedef.pdf

@ascherer
Copy link
Owner Author

ascherer commented May 15, 2024

RTFM! This issue with pointer-to-function type definitions is nicely handled in the description of the @[ and @] control codes in cwebman.tex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant