Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: Re: [hwloc-devel] 1.3.2rc1 has escaped
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2012-02-10 14:00:53

On Feb 9, 2012, at 5:38 PM, Paul H. Hargrove wrote:

>> We then test if *either* set the variable.
>> Sort of a double-negative.
> One of De Morgan's Laws:
> NOT (A AND B) = (NOT A) OR (NOT B)
> Applied to give:

I think I mis-read your initial patch, but I think we're both agreeing on the actual functionality. My definition of "pass" might well have been opposite of yours: I was saying that the compiler needs to be able to detect both scenarios (passing less than enough arguments and passing more than enough arguments).

To do that, I amended your patch to count how many of those two tests "passed". If the number of passed tests was 2, all was good. If not, fail.

This may be redundant with your original patch, but that's what I did. :-)

Here's the final logic -- is it what you intended?

    # Make sure the compiler returns an error code when function arg
    # count is wrong, otherwise sched_setaffinity checks may fail.
    AC_MSG_CHECKING([whether the C compiler rejects function calls with too many arguments])
        extern int one_arg(int x);
        int foo(void) { return one_arg(1, 2); }
    AC_MSG_CHECKING([whether the C compiler rejects function calls with too few arguments])
        extern int two_arg(int x, int y);
        int foo(void) { return two_arg(3); }
      [hwloc_args_check=`expr $hwloc_args_check + 1`
    AS_IF([test "$hwloc_args_check" != "2"],[
         AC_MSG_WARN([Your C compiler does not consider incorrect argument counts to be a fatal error.])
        case "$hwloc_c_vendor" in
            AC_MSG_WARN([Please report this warning and configure using a different C compiler if possible.])
        AS_IF([test "$HWLOC_STRICT_ARGS_CFLAGS" != "FAIL"],[
            AC_MSG_WARN([Configure will append '$HWLOC_STRICT_ARGS_CFLAGS' to the value of CFLAGS when needed.])
             AC_MSG_WARN([Alternatively you may configure with a different compiler.])

Jeff Squyres
For corporate legal information go to: