Skip to content

Commit

Permalink
Eliminate 'ISO C++17 does not allow register specifier' gcc warning
Browse files Browse the repository at this point in the history
* tools/setjmp_t.c [__cplusplus>=201703L] (main): Do not use register
specifier for x local variable.
  • Loading branch information
ivmai committed Mar 31, 2023
1 parent 7d79898 commit be7c47d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/setjmp_t.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ int main(void)
volatile word sp;
unsigned ps = GETPAGESIZE();
JMP_BUF b;
register int x = (int)strlen(a_str); /* 1, slightly disguised */
# if !defined(__cplusplus) || __cplusplus < 201703L /* before c++17 */
register
# endif
int x = (int)strlen(a_str); /* 1, slightly disguised */
static volatile int y = 0;

sp = (word)(&sp);
Expand Down

0 comments on commit be7c47d

Please sign in to comment.