ff3a562acf
This change fixes the following gcc build errors:
```
../../runtime/vm/simulator_arm.cc:1403:44: error: ‘function’ attribute directive ignored [-Werror=attributes]
1403 | int32_t r4) {
| ^
../../runtime/vm/simulator_arm.cc:1417:47: error: ‘function’ attribute directive ignored [-Werror=attributes]
1417 | double d1) {
| ^
cc1plus: note: unrecognized command-line option ‘-Wno-unused-private-field’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
```
It looks like gcc doesn't support [[no_sanitize("function")]]
attribute, so limit its usage to clang.
TEST=ci
Change-Id: Id054970b9970dd1bf9fec78e97b4dbed5fd12c82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471521
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
17 lines
667 B
C
17 lines
667 B
C
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef RUNTIME_PLATFORM_UNDEFINED_BEHAVIOR_SANITIZER_H_
|
|
#define RUNTIME_PLATFORM_UNDEFINED_BEHAVIOR_SANITIZER_H_
|
|
|
|
#ifdef __clang__
|
|
#define NO_SANITIZE_UNDEFINED(check) [[clang::no_sanitize(check)]]
|
|
#define NO_SANITIZE_UNDEFINED_FUNCTION NO_SANITIZE_UNDEFINED("function")
|
|
#else
|
|
#define NO_SANITIZE_UNDEFINED(check) [[gnu::no_sanitize(check)]]
|
|
#define NO_SANITIZE_UNDEFINED_FUNCTION
|
|
#endif
|
|
|
|
#endif // RUNTIME_PLATFORM_UNDEFINED_BEHAVIOR_SANITIZER_H_
|