Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Commit

Permalink
jpg_dec.c: suppress -Wtautological-constant-out-of-range-compare
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann authored and jubalh committed Jun 17, 2020
1 parent 681296e commit f3d4075
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libjasper/jpg/jpg_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,16 @@ jas_image_t *jpg_decode(jas_stream_t *in, const char *optstr)
*
\******************************************************************************/

#ifdef __clang__
/* suppress clang warning "result of comparison of constant
9223372036854775807 with expression of type 'JDIMENSION' (aka
'unsigned int') is always false" which happens on 64 bit targets
where int_fast32_t (64 bit) is larger than JDIMENSION (= unsigned
int, 32 bit) */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
#endif

static jas_image_t *jpg_mkimage(j_decompress_ptr cinfo)
{
jas_image_t *image;
Expand Down Expand Up @@ -413,6 +423,10 @@ static jas_image_t *jpg_mkimage(j_decompress_ptr cinfo)
return 0;
}

#ifdef __clang__
#pragma GCC diagnostic pop
#endif

/******************************************************************************\
* Data source code.
\******************************************************************************/
Expand Down

0 comments on commit f3d4075

Please sign in to comment.