Skip to content

Commit

Permalink
[compiler-rt] Suppress -Wunused-result due to ::write when _FORTIFY_S…
Browse files Browse the repository at this point in the history
…OURCE>0 in glibc

Noticed by Peter Foley.
In glibc, ::write is declared as __attribute__((__warn_unused_result__)) when __USE_FORTIFY_LEVEL is larger than 0.
  • Loading branch information
MaskRay committed Oct 12, 2020
1 parent 17cec6a commit 1ef0e94
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp
Expand Up @@ -159,7 +159,7 @@ bool IsInterestingCoverageFile(const std::string &FileName) {
}

void RawPrint(const char *Str) {
write(2, Str, strlen(Str));
(void)write(2, Str, strlen(Str));
}

void MkDir(const std::string &Path) {
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/scudo/standalone/linux.cpp
Expand Up @@ -198,7 +198,7 @@ void outputRaw(const char *Buffer) {
}
async_safe_write_log(AndroidLogInfo, "scudo", Buffer);
} else {
write(2, Buffer, strlen(Buffer));
(void)write(2, Buffer, strlen(Buffer));
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp
Expand Up @@ -10,7 +10,7 @@ extern "C" void ubsan_message(const char *msg);
static void message(const char *msg) { ubsan_message(msg); }
#else
static void message(const char *msg) {
write(2, msg, strlen(msg));
(void)write(2, msg, strlen(msg));
}
#endif

Expand Down

0 comments on commit 1ef0e94

Please sign in to comment.