Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 053dacab authored by Tom Cherry's avatar Tom Cherry
Browse files

logd: enable -Wextra

Also drop -Wall and -Werror since they're included by default now.

Test: build
Change-Id: Ib0f33d2f02e00aaf544cb0ce5acec5d8acaa8a81
parent 51780898
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -52,7 +52,9 @@ cc_library_static {

    export_include_dirs: ["."],

    cflags: ["-Werror"] + event_flag,
    cflags: [
        "-Wextra",
    ] + event_flag,
}

cc_binary {
@@ -75,7 +77,9 @@ cc_binary {
        "libcap",
    ],

    cflags: ["-Werror"],
    cflags: [
        "-Wextra",
    ],
}

cc_binary {
@@ -90,10 +94,8 @@ cc_binary {
    shared_libs: ["libbase"],

    cflags: [
        "-Wall",
        "-Wconversion",
        "-Wextra",
        "-Werror",
        "-Wconversion"
    ],
}

+1 −3
Original line number Diff line number Diff line
@@ -99,7 +99,6 @@ bool LogTags::RebuildFileEventLogTags(const char* filename, bool warn) {
            struct tm tm;
            localtime_r(&now, &tm);
            char timebuf[20];
            size_t len =
            strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", &tm);
            android::base::WriteStringToFd(
                android::base::StringPrintf(
@@ -189,7 +188,6 @@ void LogTags::AddEventLogTags(uint32_t tag, uid_t uid, const std::string& Name,
// Read the event log tags file, and build up our internal database
void LogTags::ReadFileEventLogTags(const char* filename, bool warn) {
    bool etc = !strcmp(filename, system_event_log_tags);
    bool debug = !etc && !strcmp(filename, debug_event_log_tags);

    if (!etc) {
        RebuildFileEventLogTags(filename, warn);
+0 −15
Original line number Diff line number Diff line
@@ -109,21 +109,6 @@ static int drop_privs(bool klogd, bool auditd) {
    return 0;
}

// Property helper
static bool check_flag(const char* prop, const char* flag) {
    const char* cp = strcasestr(prop, flag);
    if (!cp) {
        return false;
    }
    // We only will document comma (,)
    static const char sep[] = ",:;|+ \t\f";
    if ((cp != prop) && !strchr(sep, cp[-1])) {
        return false;
    }
    cp += strlen(flag);
    return !*cp || !!strchr(sep, *cp);
}

static int fdDmesg = -1;
void android::prdebug(const char* fmt, ...) {
    if (fdDmesg < 0) {