Skip to content

Commit

Permalink
Add PRAGMA_IGNORE_WARNING_REDUNDANT_DECLS_OVERFLOW_START for timegm
Browse files Browse the repository at this point in the history
  • Loading branch information
dajobe committed Sep 12, 2023
1 parent 92e464a commit 88b411a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
14 changes: 10 additions & 4 deletions src/rasqal_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,15 @@ void rasqal_system_free(void *ptr);
#define PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wformat-nonliteral\"")
#define PRAGMA_IGNORE_WARNING_FORMAT_OVERFLOW_START \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wformat-overflow\"")
#define PRAGMA_IGNORE_WARNING_FORMAT_TRUNCATION_START \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wformat-truncation\"")
#define PRAGMA_IGNORE_WARNING_FORMAT_OVERFLOW_START \
#define PRAGMA_IGNORE_WARNING_REDUNDANT_DECLS_OVERFLOW_START \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wformat-overflow\"")
_Pragma ("GCC diagnostic ignored \"-Wredundant-decls\"")
#define PRAGMA_IGNORE_WARNING_END \
_Pragma ("GCC diagnostic pop")
#define FALLTHROUGH_IS_OK \
Expand All @@ -208,10 +211,12 @@ void rasqal_system_free(void *ptr);
#define PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wformat-nonliteral\"")
#define PRAGMA_IGNORE_WARNING_FORMAT_TRUNCATION_START \
_Pragma ("GCC diagnostic push")
#define PRAGMA_IGNORE_WARNING_FORMAT_OVERFLOW_START \
_Pragma ("GCC diagnostic push")
#define PRAGMA_IGNORE_WARNING_FORMAT_TRUNCATION_START \
_Pragma ("GCC diagnostic push")
#define PRAGMA_IGNORE_WARNING_REDUNDANT_DECLS_OVERFLOW_START \
_Pragma ("GCC diagnostic push"
#define PRAGMA_IGNORE_WARNING_END \
_Pragma ("GCC diagnostic pop")
#define FALLTHROUGH_IS_OK \
Expand All @@ -220,6 +225,7 @@ void rasqal_system_free(void *ptr);
#define PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START
#define PRAGMA_IGNORE_WARNING_FORMAT_OVERFLOW_START
#define PRAGMA_IGNORE_WARNING_FORMAT_TRUNCATION_START
#define PRAGMA_IGNORE_WARNING_REDUNDANT_DECLS_OVERFLOW_START
#define PRAGMA_IGNORE_WARNING_END
#define FALLTHROUGH_IS_OK
#endif
Expand Down
9 changes: 6 additions & 3 deletions src/timegm.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ rasqal_timegm(struct tm *tm)

#else

/* function prototype may be in stdlib.h or stdio.h or nowhere? */
extern int setenv (const char *name, const char *value, int replace);
extern int unsetenv (const char *name);
PRAGMA_IGNORE_WARNING_REDUNDANT_DECLS_OVERFLOW_START
/* function prototype may be in stdlib.h or stdio.h or nowhere */
extern char *getenv(const char *);
extern int setenv(const char *name, const char *value, int replace);
extern int unsetenv(const char *name);

/* time.h or nowhere */
extern void tzset(void);

PRAGMA_IGNORE_WARNING_END

time_t
rasqal_timegm(struct tm *tm)
Expand Down

0 comments on commit 88b411a

Please sign in to comment.