Suppress possibly-uninitialized-variable warnings.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Jan 2018 03:16:25 +0000 (22:16 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Jan 2018 03:16:25 +0000 (22:16 -0500)
Apparently, Peter's compiler has faith that the switch test values here
could never not be valid values of their enums.  Mine does not, and
I tend to agree with it.

src/backend/catalog/aclchk.c

index de18610a912ecf78a6834099b574f3cc98b32be7..1156627b9ecc94e2be3b9243ad9507f40aaba79f 100644 (file)
@@ -3359,7 +3359,7 @@ aclcheck_error(AclResult aclerr, ObjectType objtype,
            break;
        case ACLCHECK_NO_PRIV:
            {
-               const char *msg;
+               const char *msg = "???";
 
                switch (objtype)
                {
@@ -3481,7 +3481,6 @@ aclcheck_error(AclResult aclerr, ObjectType objtype,
                    case OBJECT_TSTEMPLATE:
                    case OBJECT_USER_MAPPING:
                        elog(ERROR, "unsupported object type %d", objtype);
-                       msg = "???";
                }
 
                ereport(ERROR,
@@ -3491,7 +3490,7 @@ aclcheck_error(AclResult aclerr, ObjectType objtype,
            }
        case ACLCHECK_NOT_OWNER:
            {
-               const char *msg;
+               const char *msg = "???";
 
                switch (objtype)
                {
@@ -3616,7 +3615,6 @@ aclcheck_error(AclResult aclerr, ObjectType objtype,
                    case OBJECT_TSTEMPLATE:
                    case OBJECT_USER_MAPPING:
                        elog(ERROR, "unsupported object type %d", objtype);
-                       msg = "???";
                }
 
                ereport(ERROR,