am cd285d7d: Merge "crash_reporter: Fix initial compile issues with Android toolchain"

* commit 'cd285d7d26e42eee91daf55be3378da595fee5ad':
  crash_reporter: Fix initial compile issues with Android toolchain
This commit is contained in:
Gaurav Shah 2015-08-10 22:45:11 +00:00 committed by Android Git Automerger
commit bd1b5f34de
3 changed files with 6 additions and 4 deletions

View file

@ -4,13 +4,13 @@
#include "user_collector.h" #include "user_collector.h"
#include <bits/wordsize.h>
#include <elf.h> #include <elf.h>
#include <fcntl.h> #include <fcntl.h>
#include <grp.h> // For struct group. #include <grp.h> // For struct group.
#include <pcrecpp.h> #include <pcrecpp.h>
#include <pwd.h> // For struct passwd. #include <pwd.h> // For struct passwd.
#include <stdint.h> #include <stdint.h>
#include <sys/cdefs.h> // For __WORDSIZE
#include <sys/types.h> // For getpwuid_r, getgrnam_r, WEXITSTATUS. #include <sys/types.h> // For getpwuid_r, getgrnam_r, WEXITSTATUS.
#include <string> #include <string>

View file

@ -4,8 +4,8 @@
#include "user_collector.h" #include "user_collector.h"
#include <bits/wordsize.h>
#include <elf.h> #include <elf.h>
#include <sys/cdefs.h> // For __WORDSIZE
#include <unistd.h> #include <unistd.h>
#include <base/files/file_util.h> #include <base/files/file_util.h>

View file

@ -11,6 +11,8 @@
* shipment to the crash server. * shipment to the crash server.
*/ */
%option noyywrap
%{ %{
#include <fcntl.h> #include <fcntl.h>
#include <inttypes.h> #include <inttypes.h>
@ -122,6 +124,7 @@ static void SetHashSeen(uint32_t hash) {
hash_bitmap[word_index] |= 1 << bit_index; hash_bitmap[word_index] |= 1 << bit_index;
} }
#pragma GCC diagnostic ignored "-Wwrite-strings"
int WarnStart(void) { int WarnStart(void) {
uint32_t hash; uint32_t hash;
char *spacep; char *spacep;
@ -140,7 +143,7 @@ int WarnStart(void) {
yyout = fopen(warn_dump_path, "w"); yyout = fopen(warn_dump_path, "w");
if (yyout == NULL) if (yyout == NULL)
Die("fopen %s failed: %s\n", warn_dump_path, strerror(errno)); Die("fopen %s failed: %s\n", warn_dump_path, strerror(errno));
spacep = index(yytext, ' '); spacep = strchr(yytext, ' ');
if (spacep == NULL || spacep[1] == '\0') if (spacep == NULL || spacep[1] == '\0')
spacep = "unknown-function"; spacep = "unknown-function";
fprintf(yyout, "%08x-%s\n", hash, spacep + 1); fprintf(yyout, "%08x-%s\n", hash, spacep + 1);
@ -318,5 +321,4 @@ int main(int argc, char **argv) {
*/ */
void UnusedFunctionWarningSuppressor(void) { void UnusedFunctionWarningSuppressor(void) {
yyunput(0, 0); yyunput(0, 0);
(void) input();
} }