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

string concatenation #246

Closed
antikostya opened this issue Oct 21, 2021 · 1 comment
Closed

string concatenation #246

antikostya opened this issue Oct 21, 2021 · 1 comment

Comments

@antikostya
Copy link

Describe the bug
norminette does not allow string concatenation in header files

Erroneous code
if we try to define literal consisting two string - we getting an error

#ifndef _H
# define _H

# define HELLO		"Hello, "
# define WORLD		"world!"

# define STRING1	"Hello, " "world!"
# define STRING2	HELLO "world!"
# define STRING3	"Hello, " WORLD
# define STRING4	HELLO WORLD

#endif

non of these ways are allowed
norminette return

Error: TOO_MANY_VALS        (line:   7, col:  27):	Too many values on define
Error: TOO_MANY_VALS        (line:   8, col:  23):	Too many values on define
Error: TOO_MANY_VALS        (line:   9, col:  31):	Too many values on define
Error: TOO_MANY_VALS        (line:  10, col:  27):	Too many values on define

It also means, that there is no possibility to define large literals wich are longer than 67 characters

Additional infos

  • OS: Linuxmint 20.2 uma
  • python --version: Python 3.8.10
  • norminette -v: norminette 3.3.40
@N0ich
Copy link
Contributor

N0ich commented Nov 5, 2021

Hello,
I can reenable basic string concat/maths in define stuff, but it's not up to me.
That's a design choice by 42network so for now i won't reenable it.
I'll ask around
Have a good day

@N0ich N0ich closed this as completed Nov 5, 2021
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

2 participants