Skip to content

Commit

Permalink
Suppress gcc/clang warning for {0} idiom Close #2
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-rgb committed Oct 21, 2015
1 parent f6d01b8 commit f7479d0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tiny_jpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ extern "C"
{
#endif

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers" // We use {0}, which will zero-out the struct.
#pragma GCC diagnostic ignored "-Wmissing-braces"
#endif

// ============================================================9
// Public interface:
Expand Down Expand Up @@ -1171,6 +1176,11 @@ int tje_encode_to_file_at_quality(const char* dest_path,
// ============================================================
#endif // TJE_IMPLEMENTATION
// ============================================================
//
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif


#ifdef __cplusplus
} // extern C
Expand Down

0 comments on commit f7479d0

Please sign in to comment.