bug-autoconf
[Top][All Lists]
Advanced

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

Re: Intel compiler and autoconf


From: Akim Demaille
Subject: Re: Intel compiler and autoconf
Date: 31 Oct 2002 10:18:25 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

>>>>> "Akim" == Akim Demaille <address@hidden> writes:

Akim> If you think there is a problem with Autoconf and icc, fetch
Akim> autoconf, configure, make, and then

Akim>         cd tests ./testsuite CC=icc

Akim> I'm running it currently, and it seems to work just fine.

If have a failure on AC_CHECK_TYPES (test 77 on CVS Autoconf):

   AC_INIT
   AC_CONFIG_AUX_DIR($top_srcdir/config)
   AC_CONFIG_HEADER(config.h:config.hin)
   AC_STATE_SAVE(before)
   AC_CHECK_TYPES([int, struct yes_s, struct no_s],,,
                    [struct yes_s { int yes ;} ;])
   AC_OUTPUT
   AC_STATE_SAVE(after)

says yes to `struct no_s':

configure:2221: checking for struct no_s
configure:2247: icc -c -g  conftest.c >&5
conftest.c
configure(2241): warning #279: controlling expression is constant
  if ((struct no_s *) 0)
      ^

configure(2243): warning #70: incomplete type is not allowed
  if (sizeof (struct no_s))
              ^

configure:2250: $? = 0
configure:2253: test -s conftest.o
configure:2256: $? = 0
configure:2267: result: yes


And indeed:

  imladris% cat foo.c       
  #include <stdio.h>
  struct yes_s { int yes ;} ;
  
  int
  main ()
  {
    printf ("sizeof (struct no_s) = %d\n", sizeof (struct no_s));
  if ((struct no_s *) 0)
    return 1;
  if (sizeof (struct no_s))
    return 2;
    ;
    return 0;
  }
  imladris% icc foo.c       
  foo.c
  foo.c(7): warning #70: incomplete type is not allowed
      printf ("sizeof (struct no_s) = %d\n", sizeof (struct no_s));
                                                     ^
  
  foo.c(8): warning #279: controlling expression is constant
    if ((struct no_s *) 0)
        ^
  
  foo.c(10): warning #70: incomplete type is not allowed
    if (sizeof (struct no_s))
                ^
  
  imladris% ./a.out; echo $?
  sizeof (struct no_s) = 0
  0
  imladris% 


NB: We could use the AC_CHECK_SIZEOF technique to test for the
existence of a type.  Unless we care about types without contents.




reply via email to

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