[Click] Configure and timespec

Eddie Kohler kohler at cs.ucla.edu
Sat Oct 16 18:04:25 EDT 2010


Hi Roberto,

I looked into this, and there is no problem.  This is right.  When checking 
for the existence of a type in C++, Autoconf compiles the program you've 
pasted below, twice, with one small change.  The first program contains

if (sizeof (struct timespec))

(one set of parens).  The second contains

if (sizeof ((struct timespec)))

(two sets of parens: should fail if "struct timespec" is a type).  The first 
compile must succeed (as it does for you), and the second must fail (as it 
does for you).

Eddie


On 10/14/2010 06:16 AM, Roberto Riggio wrote:
> Hi,
>
> this is not actually creating any problem to me. I'm reporting it just
> in case it may
> prove useful. Lurking in the configure.log, I've found the following error:
>
> configure:7464: checking for struct timespec
> configure:7464: g++ -W -Wall -c -g -O2 conftest.cpp >&5
> configure:7464: $? = 0
> configure:7464: g++ -W -Wall -c -g -O2 conftest.cpp >&5
> conftest.cpp: In function 'int main()':
> conftest.cpp:101: error: expected primary-expression before 'struct'
> conftest.cpp:101: error: expected ')' before 'struct'
> conftest.cpp:102: error: expected ')' before ';' token
> conftest.cpp:102: error: expected ')' before ';' token
> conftest.cpp:102: warning: suggest braces around empty body in an 'if'
> statement
> configure:7464: $? = 1
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME "click"
> | #define PACKAGE_TARNAME "click"
> | #define PACKAGE_VERSION "1.8.0"
> | #define PACKAGE_STRING "click 1.8.0"
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE_URL ""
> | #define CLICK_VERSION "1.8.0"
> | #define CLICK_VERSION_CODE CLICK_MAKE_VERSION_CODE(1,8,0)
> | #define STDC_HEADERS 1
> | #define HAVE_SYS_TYPES_H 1
> | #define HAVE_SYS_STAT_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_MEMORY_H 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_INTTYPES_H 1
> | #define HAVE_STDINT_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_SYS_TYPES_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_NEW_HDR 1
> | #define NUM_CLICK_CPUS 1
> | #define HAVE_CLICKFS 1
> | #define LINUX_SRCDIR "NONE"
> | #define FREEBSD_INCLUDEDIR "/usr/include"
> | #define HAVE_STRERROR 1
> | #define HAVE_RANDOM 1
> | #define HAVE_SNPRINTF 1
> | #define HAVE_STRNLEN 1
> | #define HAVE_STRTOUL 1
> | #define HAVE_TCGETPGRP 1
> | #define HAVE_VSNPRINTF 1
> | #define SIZEOF_INT 4
> | #define SIZEOF_LONG 4
> | #define SIZEOF_SIZE_T 4
> | #define SIZEOF_VOID_P 4
> | #define HAVE_INTTYPES_H 1
> | #define HAVE_INDIFFERENT_ALIGNMENT 1
> | #define SIZEOF_LONG_LONG 8
> | #define HAVE_LONG_LONG 1
> | #define HAVE_INT64_T 1
> | #define HAVE_UINT64_T 1
> | #define HAVE_INT64_TYPES 1
> | #define HAVE_INT64_IS_LONG_LONG_USERLEVEL 1
> | #define HAVE_ENDIAN_H 1
> | #define CLICK_BYTE_ORDER 1234
> | #define HAVE_BYTESWAP_H 1
> | #define HAVE_ARITHMETIC_RIGHT_SHIFT 1
> | #define HAVE_ADDRESSABLE_VA_LIST 1
> | #define HAVE___BUILTIN_CLZ 1
> | #define HAVE___BUILTIN_CLZL 1
> | #define HAVE___BUILTIN_CLZLL 1
> | #define HAVE___BUILTIN_FFS 1
> | #define HAVE___BUILTIN_FFSL 1
> | #define HAVE___BUILTIN_FFSLL 1
> | #define HAVE___SYNC_SYNCHRONIZE 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_FFS 1
> | #define HAVE_FFSL 1
> | #define HAVE_FFSLL 1
> | #define HAVE_TIME_H 1
> | #define SIZEOF_STRUCT_TIMEVAL 8
> | /* end confdefs.h. */
> | #include <stdio.h>
> | #ifdef HAVE_SYS_TYPES_H
> | # include <sys/types.h>
> | #endif
> | #ifdef HAVE_SYS_STAT_H
> | # include <sys/stat.h>
> | #endif
> | #ifdef STDC_HEADERS
> | # include <stdlib.h>
> | # include <stddef.h>
> | #else
> | # ifdef HAVE_STDLIB_H
> | # include <stdlib.h>
> | # endif
> | #endif
> | #ifdef HAVE_STRING_H
> | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
> | # include <memory.h>
> | # endif
> | # include <string.h>
> | #endif
> | #ifdef HAVE_STRINGS_H
> | # include <strings.h>
> | #endif
> | #ifdef HAVE_INTTYPES_H
> | # include <inttypes.h>
> | #endif
> | #ifdef HAVE_STDINT_H
> | # include <stdint.h>
> | #endif
> | #ifdef HAVE_UNISTD_H
> | # include <unistd.h>
> | #endif
> | int
> | main ()
> | {
> | if (sizeof ((struct timespec)))
> | return 0;
> | ;
> | return 0;
> | }
> configure:7464: result: yes
>
> It looks like albeit the compilation fails, the configure reports that
> timespec
> is actually available.
>
>
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list