[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)

From: Brian Barrett
Subject: (no subject)
Date: Thu, 10 May 2007 09:45:17 -0600

Hi all -

I've run into two sets of warnings in the LT2 libltdl code when using GCC (4.0.1 on OS X in this case, although they will occur with any recent version of GCC on at least OS X and Linux). I compiled with CFLAGS set to: "-Wall -Wundef -Wno-long-long -Wsign-compare -Wmissing- prototypes -Wstrict-prototypes -Wcomment -pedantic -Wno-long-double - Werror-implicit-function-declaration -finline-functions -fno-strict- aliasing" which are the flags we use for Open MPI.

In file included from libltdl/loaders/dlopen.c:33:
./libltdl/libltdl/lt__private.h:77:63: warning: "__STRICT_ANSI__" is not defined

libltdl/loaders/preopen.c: In function 'free_symlists':
libltdl/loaders/preopen.c:245: warning: ISO C forbids braced-groups within expressions

There are many more of both warnings, but I only included each once. I've attached a patch against the head of the cvs repository that seems to clear both issues up. I couldn't figure out why the GCC- specific version of LT_STMT_START and LT_STMT_END were needed -- GCC seems to always accept the do ... while(0) version of the macros, and doesn't emit warnings when they're in use.

With the patch, there are still three warnings that I see, that I'm unable to find the best way to handle. Two are object pointer -> function pointer casting and one is a declaration warning in libltdlS.c:

libltdl/ltdl.c: In function 'loader_init_callback':
libltdl/ltdl.c:165: warning: ISO C forbids conversion of object pointer to function pointer type
libltdlS.c:9: warning: function declaration isn't a prototype
libltdlS.c:23: warning: ISO C forbids conversion of function pointer to object pointer type

In Open MPI, we're overly particular about warnings, so we've used a union to cast between object and function pointers. Not my favorite thing, but some people are really uppity about warnings ;). I can't find a better solution to getting rid of the warnings, so I didn't fix them. Perhaps someone else can find a less intrusive fix.

The magic of libltdlS.c always takes me a long time to figure out, so I didn't spend much time worrying about the function declaration without a prototype (easy to work around, if I could figure out exactly where that file was coming from...)

Is this something that could be committed to the trunk? I've tested on OS X and Linux with GCC, so it could probably use a bit more testing...



  Brian W. Barrett
  Open MPI Team, CCS-1
  Los Alamos National Laboratory

Attachment: warnings_fix.diff
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]