1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-06-20 01:17:49 +02:00

Enable redundant-decls compiler warning.

Warn if anything is declared more than once in the same scope, even when the extra declaration is valid and changes nothing. This is primarily useful for catching missing header ifdef barriers.

Move the environ variable into config/parse.h since it must be declared by us and we use it multiple times.
This commit is contained in:
David Steele
2024-10-28 19:13:38 +02:00
parent 9ec9b9d120
commit 98670aee89
5 changed files with 12 additions and 10 deletions
+3
View File
@@ -67,6 +67,9 @@ warning_enable = [
# Warn about anything that depends on the “size of” a function type or of void
'-Wpointer-arith',
# Warn if anything is declared more than once in the same scope, even when the extra declaration is valid and changes nothing
'-Wredundant-decls',
# Warn if a function is declared or defined without specifying the argument types
'-Wstrict-prototypes',
-5
View File
@@ -10,11 +10,6 @@ Support Command
#include "config/config.h"
#include "config/parse.h"
/***********************************************************************************************************************************
In some environments this will not be externed
***********************************************************************************************************************************/
extern char **environ;
/***********************************************************************************************************************************
Render config
***********************************************************************************************************************************/
-5
View File
@@ -41,11 +41,6 @@ Standard config file name and old default path and name
#define PGBACKREST_CONFIG_ORIG_PATH_FILE "/etc/" PROJECT_CONFIG_FILE
STRING_STATIC(PGBACKREST_CONFIG_ORIG_PATH_FILE_STR, PGBACKREST_CONFIG_ORIG_PATH_FILE);
/***********************************************************************************************************************************
In some environments this will not be externed
***********************************************************************************************************************************/
extern char **environ;
/***********************************************************************************************************************************
Mem context and local variables
***********************************************************************************************************************************/
+5
View File
@@ -19,6 +19,11 @@ Prefix for environment variables
#define PGBACKREST_ENV "PGBACKREST_"
#define PGBACKREST_ENV_SIZE (sizeof(PGBACKREST_ENV) - 1)
/***********************************************************************************************************************************
In some environments this will not be extern'd
***********************************************************************************************************************************/
extern char **environ;
/***********************************************************************************************************************************
Option type enum
***********************************************************************************************************************************/
+4
View File
@@ -1,6 +1,8 @@
/***********************************************************************************************************************************
Harness for Stack Trace Testing
***********************************************************************************************************************************/
#ifndef TEST_COMMON_HARNESS_STACKTRACE_H
#define TEST_COMMON_HARNESS_STACKTRACE_H
/***********************************************************************************************************************************
Functions
@@ -10,3 +12,5 @@ Functions
void hrnStackTraceBackShimInstall(void);
void hrnStackTraceBackShimUninstall(void);
#endif
#endif