Skip to content

[3.10] GH-99086: Fix -Wstrict-prototypes, -Wimplicit-function-declara… #99920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``-Wimplicit-int``, ``-Wstrict-prototypes``, and ``-Wimplicit-function-declaration`` compiler warnings in :program:`configure` checks.
52 changes: 28 additions & 24 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5929,7 +5929,7 @@ if test "x$enable_profiling" = xyes; then
CC="$CC -pg"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main() { return 0; }
int main(void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :

Expand Down Expand Up @@ -7752,7 +7752,7 @@ else

void* routine(void* p){return NULL;}

int main(){
int main(void){
pthread_t p;
if(pthread_create(&p,NULL,routine,NULL)!=0)
return 1;
Expand Down Expand Up @@ -7808,7 +7808,7 @@ else

void* routine(void* p){return NULL;}

int main(){
int main(void){
pthread_t p;
if(pthread_create(&p,NULL,routine,NULL)!=0)
return 1;
Expand Down Expand Up @@ -7858,7 +7858,7 @@ else

void* routine(void* p){return NULL;}

int main(){
int main(void){
pthread_t p;
if(pthread_create(&p,NULL,routine,NULL)!=0)
return 1;
Expand Down Expand Up @@ -7908,7 +7908,7 @@ else

void* routine(void* p){return NULL;}

int main(){
int main(void){
pthread_t p;
if(pthread_create(&p,NULL,routine,NULL)!=0)
return 1;
Expand Down Expand Up @@ -10447,7 +10447,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int main()
int main(void)
{
char s[16];
int i, *p1, *p2;
Expand Down Expand Up @@ -11024,6 +11024,7 @@ $as_echo_n "checking for pthread_create in -lpthread... " >&6; }
/* end confdefs.h. */

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

void * start_routine (void *arg) { exit (0); }
Expand Down Expand Up @@ -11325,7 +11326,7 @@ else
void *foo(void *parm) {
return NULL;
}
int main() {
int main(void) {
pthread_attr_t attr;
pthread_t id;
if (pthread_attr_init(&attr)) return (-1);
Expand Down Expand Up @@ -12687,7 +12688,7 @@ else

#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char*argv[])
int main(int argc, char *argv[])
{
if(chflags(argv[0], 0) != 0)
return 1;
Expand Down Expand Up @@ -12736,7 +12737,7 @@ else

#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char*argv[])
int main(int argc, char *argv[])
{
if(lchflags(argv[0], 0) != 0)
return 1;
Expand Down Expand Up @@ -13653,7 +13654,7 @@ else
#include <sys/socket.h>
#include <netinet/in.h>

int main()
int main(void)
{
int passive, gaierr, inet4 = 0, inet6 = 0;
struct addrinfo hints, *ai, *aitop;
Expand Down Expand Up @@ -14880,7 +14881,7 @@ else

#include <stdlib.h>
#include <math.h>
int main() {
int main(void) {
volatile double x, y, z;
/* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */
x = 0.99999999999999989; /* 1-2**-53 */
Expand Down Expand Up @@ -15730,7 +15731,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int main()
int main(void)
{
return (((-1)>>3 == -1) ? 0 : 1);
}
Expand Down Expand Up @@ -16178,7 +16179,7 @@ else

#include <stdlib.h>
#include <unistd.h>
int main()
int main(void)
{
int val1 = nice(1);
if (val1 != -1 && val1 == nice(2))
Expand Down Expand Up @@ -16221,7 +16222,7 @@ else
#include <poll.h>
#include <unistd.h>

int main()
int main(void)
{
struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
int poll_test;
Expand Down Expand Up @@ -16279,7 +16280,7 @@ else
extern char *tzname[];
#endif

int main()
int main(void)
{
/* Note that we need to ensure that not only does tzset(3)
do 'something' with localtime, but it works as documented
Expand Down Expand Up @@ -17040,9 +17041,10 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <stddef.h>
#include <stdio.h>
#include<stdlib.h>
int main() {
#include <stdlib.h>
int main(void) {
size_t len = -1;
const char *str = "text";
len = mbstowcs(NULL, str, 0);
Expand Down Expand Up @@ -17219,7 +17221,7 @@ else
#include <stdlib.h>
#include <string.h>
void foo(void *p, void *q) { memmove(p, q, 19); }
int main() {
int main(void) {
char a[32] = "123456789000000000";
foo(&a[9], a);
if (strcmp(a, "123456789123456789000000000") != 0)
Expand Down Expand Up @@ -17274,7 +17276,7 @@ else
);
return r;
}
int main() {
int main(void) {
int p = 8;
if ((foo(&p) ? : p) != 6)
return 1;
Expand Down Expand Up @@ -17313,7 +17315,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#include <stdatomic.h>
atomic_int int_var;
atomic_uintptr_t uintptr_var;
int main() {
int main(void) {
atomic_store_explicit(&int_var, 5, memory_order_relaxed);
atomic_store_explicit(&uintptr_var, 0, memory_order_relaxed);
int loaded_value = atomic_load_explicit(&int_var, memory_order_seq_cst);
Expand Down Expand Up @@ -17347,7 +17349,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext


int val;
int main() {
int main(void) {
__atomic_store_n(&val, 1, __ATOMIC_SEQ_CST);
(void)__atomic_load_n(&val, __ATOMIC_SEQ_CST);
return 0;
Expand Down Expand Up @@ -17406,7 +17408,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext

#include <dirent.h>

int main() {
int main(void) {
struct dirent entry;
return entry.d_type == DT_UNKNOWN;
}
Expand Down Expand Up @@ -17436,11 +17438,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */


#include <stddef.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <linux/random.h>

int main() {
int main(void) {
char buffer[1];
const size_t buflen = sizeof(buffer);
const int flags = GRND_NONBLOCK;
Expand Down Expand Up @@ -17475,9 +17478,10 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */


#include <stddef.h>
#include <sys/random.h>

int main() {
int main(void) {
char buffer[1];
const size_t buflen = sizeof(buffer);
const int flags = 0;
Expand Down
Loading