Skip to content

Commit

Permalink
lib: fix missing prototypes (OSGeo#4191)
Browse files Browse the repository at this point in the history
* r.report: add missing prototype

* lib/db: add missing prototype

* CI: fail macOS runner on -Wstrict-prototypes

* lib/gmath: suppress -Wstrict-prototypes for BLAS/LAPACK wrapper header
  • Loading branch information
nilason authored Aug 23, 2024
1 parent 917ba58 commit b794d95
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export CPPFLAGS="-isystem${CONDA_PREFIX}/include"

./configure $CONFIGURE_FLAGS

EXEMPT="-Wno-error=deprecated-non-prototype -Wno-error=strict-prototypes"
EXEMPT=""
make -j$(sysctl -n hw.ncpu) CFLAGS="$CFLAGS -Werror $EXEMPT" \
CXXFLAGS="$CXXFLAGS -Werror $EXEMPT"

Expand Down
16 changes: 15 additions & 1 deletion include/grass/la.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typedef long int __g77_longint;
typedef unsigned long int __g77_ulongint;

#include <g2c.h>
#else /* for gcc4+ */
#else /* for gcc4+ */
typedef int integer;
typedef unsigned int uinteger;
typedef char *address;
Expand All @@ -67,6 +67,14 @@ typedef unsigned long ulongint;
/* IO stuff */
typedef int ftnlen;

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wstrict-prototypes"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#endif

/* procedure parameter types for -A */
typedef int (*U_fp)();
typedef shortint (*J_fp)();
Expand All @@ -80,6 +88,12 @@ typedef shortlogical (*K_fp)();
typedef void (*H_fp)();
typedef int (*S_fp)();

#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

/* E_fp is for real functions when -R is not specified */
typedef void C_f; /* complex function */
typedef void H_f; /* character function */
Expand Down
2 changes: 1 addition & 1 deletion lib/db/sqlp/sqlp.l
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void yyerror( const char *s )
* of this func anyway so we can avoid the link dependency.
*
**********************************************************************/
int yywrap()
int yywrap(void)
{
return 1;
}
2 changes: 1 addition & 1 deletion raster/r.report/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int print_unit(int, int, int);
JSON_Value *make_units(int, int);
JSON_Value *make_category(int, int, JSON_Value *);
JSON_Value *make_categories(int, int, int);
void print_json();
void print_json(void);

/* report.c */
int report(void);
Expand Down
2 changes: 1 addition & 1 deletion raster/r.report/prt_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ JSON_Value *make_categories(int start, int end, int level)
return array_value;
}

void print_json()
void print_json(void)
{
compute_unit_format(0, nunits - 1, JSON);

Expand Down

0 comments on commit b794d95

Please sign in to comment.