forked from 42School/norminette
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close 42School#203 - Fixed errors with __attribute__ on func prototyp…
…es, declarations
- Loading branch information
N01ch
committed
Aug 26, 2021
1 parent
d02232a
commit d778eb5
Showing
6 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
void fatal(void) __attribute__((noreturn)); | ||
|
||
extern int ft_printf(void *obj, const char *format, ...) | ||
__attribute__ ((format (printf, 2, 3))); | ||
|
||
float __attribute__((overloadable)) len(t_float2 a); | ||
|
||
float len(t_float2 a) __attribute__((overloadable)) | ||
{ | ||
t_float2 v; | ||
|
||
v = a; | ||
return (sqrt(a.x * a.x + a.y * a.y)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Missing or invalid header. Header are being reintroduced as a mandatory part of your files. This is not yet an error. | ||
[36mtests/rules/check_attributes.c[0m - [32mIsFuncPrototype[0m In "GlobalScope" from "None" line 1": | ||
<FLOAT> <SPACE> <IDENTIFIER=__attribute__> <LPARENTHESIS> <LPARENTHESIS> <IDENTIFIER=overloadable> <RPARENTHESIS> <RPARENTHESIS> <SPACE> <IDENTIFIER=len> <LPARENTHESIS> <IDENTIFIER=t_float2> <SPACE> <IDENTIFIER=a> <RPARENTHESIS> <SEMI_COLON> <NEWLINE> | ||
[36mtests/rules/check_attributes.c[0m - [32mIsFuncPrototype[0m In "GlobalScope" from "None" line 2": | ||
<VOID> <TAB> <TAB> <IDENTIFIER=fatal> <LPARENTHESIS> <VOID> <RPARENTHESIS> <SPACE> <IDENTIFIER=__attribute__> <LPARENTHESIS> <LPARENTHESIS> <IDENTIFIER=noreturn> <RPARENTHESIS> <RPARENTHESIS> <SEMI_COLON> <NEWLINE> | ||
[36mtests/rules/check_attributes.c[0m - [32mIsEmptyLine[0m In "GlobalScope" from "None" line 3": | ||
<NEWLINE> | ||
[36mtests/rules/check_attributes.c[0m - [32mIsFuncPrototype[0m In "GlobalScope" from "None" line 4": | ||
<EXTERN> <SPACE> <INT> <TAB> <IDENTIFIER=ft_printf> <LPARENTHESIS> <VOID> <SPACE> <MULT> <IDENTIFIER=obj> <COMMA> <SPACE> <CONST> <SPACE> <CHAR> <SPACE> <MULT> <IDENTIFIER=format> <COMMA> <SPACE> <ELLIPSIS> <RPARENTHESIS> <NEWLINE> | ||
<TAB> <TAB> <IDENTIFIER=__attribute__> <SPACE> <LPARENTHESIS> <LPARENTHESIS> <IDENTIFIER=format> <SPACE> <LPARENTHESIS> <IDENTIFIER=printf> <COMMA> <SPACE> <CONSTANT=2> <COMMA> <SPACE> <CONSTANT=3> <RPARENTHESIS> <RPARENTHESIS> <RPARENTHESIS> <SEMI_COLON> | ||
tests/rules/check_attributes.c: OK! |