Warning in pg_backup_archiver.c - Mailing list pgsql-hackers

From Michael Paquier
Subject Warning in pg_backup_archiver.c
Date
Msg-id CAB7nPqRi-2e3h8V0J4ZxK1Fcnjtt4Kg99Nm+D_qZtcsZtiPsSg@mail.gmail.com
Whole thread Raw
Responses Re: Warning in pg_backup_archiver.c  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Hi,

While compiling on clang, I noticed the following warning:
pg_backup_archiver.c:1950:32: warning: comparison of constant -1 with expression of type 'ArchiveFormat' (aka 'enum _archiveFormat') is always false
      [-Wtautological-constant-out-of-range-compare]
                if ((AH->format = fgetc(fh)) == EOF)
                    ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
Something like the patch attached calms down the compiler... This has been introduced recently by commit cfa1b4a of the 9th of February.
Regards,
--
Michael
Attachment

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: inherit support for foreign tables
Next
From: Etsuro Fujita
Date:
Subject: Re: inherit support for foreign tables