Squish various compiler warnings

* CPP's defined() is UB outside of a #if line
* Use (void)! cast to prevent recent GCCs & glibc from warning
  about ignoring the return status from chdir()
This commit is contained in:
Andrew Johnson
2021-06-20 12:47:38 -05:00
parent ac6eb5e212
commit cb5f68994f
3 changed files with 11 additions and 6 deletions

View File

@@ -90,7 +90,7 @@ int main(int argc, char* argv[])
(void)detachinout;
#endif
chdir ( "/" );
(void)! chdir ( "/" );
ca_repeater ();
return ( 0 );
}

View File

@@ -606,12 +606,12 @@ void CA_put(SV *ca_ref, SV *val, ...) {
}
} else {
union {
void *dbr;
dbr_char_t *dbr_char;
dbr_long_t *dbr_long;
dbr_double_t *dbr_double;
char *dbr_string;
void *dbr;
} p;
} p = {0};
int i;
chtype type = best_type(pch);
@@ -699,12 +699,12 @@ void CA_put_callback(SV *ca_ref, SV *sub, SV *val, ...) {
}
} else {
union {
void *dbr;
dbr_char_t *dbr_char;
dbr_long_t *dbr_long;
dbr_double_t *dbr_double;
char *dbr_string;
void *dbr;
} p;
} p = {0};
int i;
chtype type = best_type(pch);