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

Hangs when using curly braces in "wired" places #521

Open
Dyamen1411 opened this issue Nov 28, 2024 · 0 comments
Open

Hangs when using curly braces in "wired" places #521

Dyamen1411 opened this issue Nov 28, 2024 · 0 comments

Comments

@Dyamen1411
Copy link

Describe the bug

I'm trying to develop a unit-test library and for that I need to use macro functions.

When putting a code block (so basically code with curly braces around it) as the last argument of my macro function, the norminette just hangs and never recovers.

Please fix this and don't just tell me this won't pass the norminette, this can be a problem under other circumstance !
This is not an edge-case !

Tanks for reading ;)


Erroneous code

This is the definition of the macro function (norminette does not hang):

#define UNIT_TEST(fname, code, ...)	\
	int	__unit_test__##fname() code##__VA_OPT__(,) __VA_ARGS__

This is the code that uses the macro function (norminette hangs):

UNIT_TEST(my_unit_test,					\
	{						\
		int x = 0, y = 0, z = 0;		\
		return (x == 0 && y == 0 && z == 0);	\
	}						\
)

Additional infos

Latest norminette version under arch linux (norminette 3.3.54)

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

No branches or pull requests

1 participant