[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
autoconf error with MS VC++ 2015
From: |
Jan Rheinländer |
Subject: |
autoconf error with MS VC++ 2015 |
Date: |
Wed, 2 Nov 2016 20:50:45 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
Hi,
I'm configuring with autoconf (Ubuntu 16.04 standard package: Version:
2.69-9) using
Microsoft (R) C/C++-Optimierungscompiler Version 19.00.24215.1 für x86
The following test gives an infinite loop because compilation of
contest.cpp always fails:
---
configure: checking for integer types and behaviour...
creating
---
The conftest.cpp in question contains
---
#ifdef __cplusplus
# ifdef __GNUC__
# define alignof(type) __alignof__ (type)
# else
template <class type> struct alignof_helper { char slot1; type slot2; };
# define alignof(type) offsetof (alignof_helper<type>, slot2)
# endif
#else
# define alignof(type) offsetof (struct { char slot1; type slot2; }, slot2)
#endif
int
main ()
{
typedef int verify[2*(alignof(char) == 76) - 1];
;
return 0;
}
---
The compiler gives the following error messages (I translated them from
German):
---
conftest.cpp(45): error C2275: "alignof_helper<char>": illegal use of
this type as an expression
conftest.cpp(45): note: See declaration of "alignof_helper<char>"
conftest.cpp(45): error C2065: "slot2": undeclared identifier
conftest.cpp(45): error C3861: "offsetof": identifier was not found
---
What does work is:
---
#include <stddef.h>
struct alignof_helper { char slot1; char slot2; };
int
main ()
{
typedef int verify[2*(offsetof(struct alignof_helper, slot2) == 1) - 1];
;
return 0;
}
---
and the program compiles fine when the test is == 1 and fails with error
C2118: "negative index" when it is == 2.
Greetings,
Jan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- autoconf error with MS VC++ 2015,
Jan Rheinländer <=