-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
Issue description:
While working on an implementation of named-only function arguments (#719), I found an oversight in function declargs()
.
compiler/source/compiler/sc1.c
Lines 4278 to 4282 in 81b4a02
case tCONST: | |
if (ident!=iVARIABLE || numtags>0 || fpragma) | |
error(1,sc_tokens[tSYMBOL-tFIRST],sc_tokens[tCONST-tFIRST]); | |
fconst=TRUE; | |
break; |
There's no check if
const
was already specified, although handlers for other specifiers (&
, Tag:
, ...
) have this kind of check.As a result, the user can specify
const
any number of times
Func(const const const const arg) {}
and the compiler would think this is okay, although it clearly isn't.
Minimal complete verifiable example (MCVE):
See above.
Workspace Information:
- Compiler version: 3.10.10
- Command line arguments provided (or sampctl version): Not relevant.
- Operating System: Not relevant.
Metadata
Metadata
Assignees
Labels
No labels