Skip to content

Commit 431c6d1

Browse files
committed
sw: Correct unknown attribute 'optimize' compiler warning
1 parent 43cfae0 commit 431c6d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sw/tests/varargs_1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44
#include <stdarg.h>
55

6-
// Use `-O1` for this function and don't inline.
7-
int __attribute__((noinline)) __attribute__((optimize(1))) sum(int N, ...) {
6+
// Use `-O0` for this function and don't inline.
7+
int __attribute__((noinline)) __attribute__((optnone)) sum(int N, ...) {
88
int sum = 0;
99
va_list va;
1010
va_start(va, N);

sw/tests/varargs_2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44
#include <stdarg.h>
55

6-
// Use `-O1` for this function and don't inline.
7-
int __attribute__((noinline)) __attribute__((optimize(1)))
6+
// Use `-O0` for this function and don't inline.
7+
int __attribute__((noinline)) __attribute__((optnone))
88
sum(int dummy0, int dummy1, int dummy2, int dummy3, int dummy4, int dummy5,
99
int dummy6, int N, ...) {
1010
(void)dummy0;

0 commit comments

Comments
 (0)