diff --git a/crash_reporter/user_collector.cc b/crash_reporter/user_collector.cc index ac2f90ef2..069b581b7 100644 --- a/crash_reporter/user_collector.cc +++ b/crash_reporter/user_collector.cc @@ -4,13 +4,13 @@ #include "user_collector.h" -#include #include #include #include // For struct group. #include #include // For struct passwd. #include +#include // For __WORDSIZE #include // For getpwuid_r, getgrnam_r, WEXITSTATUS. #include diff --git a/crash_reporter/user_collector_test.cc b/crash_reporter/user_collector_test.cc index a0ada0657..ee3ca128b 100644 --- a/crash_reporter/user_collector_test.cc +++ b/crash_reporter/user_collector_test.cc @@ -4,8 +4,8 @@ #include "user_collector.h" -#include #include +#include // For __WORDSIZE #include #include diff --git a/crash_reporter/warn_collector.l b/crash_reporter/warn_collector.l index 691ef9913..de746feff 100644 --- a/crash_reporter/warn_collector.l +++ b/crash_reporter/warn_collector.l @@ -11,6 +11,8 @@ * shipment to the crash server. */ +%option noyywrap + %{ #include #include @@ -122,6 +124,7 @@ static void SetHashSeen(uint32_t hash) { hash_bitmap[word_index] |= 1 << bit_index; } +#pragma GCC diagnostic ignored "-Wwrite-strings" int WarnStart(void) { uint32_t hash; char *spacep; @@ -140,7 +143,7 @@ int WarnStart(void) { yyout = fopen(warn_dump_path, "w"); if (yyout == NULL) Die("fopen %s failed: %s\n", warn_dump_path, strerror(errno)); - spacep = index(yytext, ' '); + spacep = strchr(yytext, ' '); if (spacep == NULL || spacep[1] == '\0') spacep = "unknown-function"; fprintf(yyout, "%08x-%s\n", hash, spacep + 1); @@ -318,5 +321,4 @@ int main(int argc, char **argv) { */ void UnusedFunctionWarningSuppressor(void) { yyunput(0, 0); - (void) input(); }