Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang option "-fms-extensions" is ignored for intellisense for clang-based compiler after Version 1.3.1 #7886

Closed
Helmta opened this issue Jul 28, 2021 · 8 comments
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@Helmta
Copy link

Helmta commented Jul 28, 2021

Bug type: Language Service

VS-Code Version: 1.58.2 (system setup)
OS: Windows_NT x64 10.0.18363

Hi,
we are using Embarcadero C++ Builder 10.3 as our C++ compiler. It's a clang-based compiler.
We are using cmake+ninja for compilation and it works but we can not use cmake as configuration-provider.

relevant setting:

"C_Cpp.default.intelliSenseMode": "windows-clang-x64",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.cStandard": "c11",
"C_Cpp.default.systemIncludePath": [
"C:/prg/Embarcadero/Studio/20.0/include/dinkumware64/",
"C:/prg/Embarcadero/Studio/20.0/include/boost_1_68/",
"C:/prg/Embarcadero/Studio/20.0/include/windows/
"
],
"C_Cpp.default.configurationProvider": "${default}", //suppress cmake asking for intellisense-provider on every startup
"C_Cpp.default.compilerPath": "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe",
"C_Cpp.default.compilerArgs": [
"-fms-extensions"
],
"C_Cpp.intelliSenseEngine": "Default",

With C/C++ Version 1.3.1

C/C++ Logs in Debug-Mode:
Attempting to get defaults from C compiler in "compilerPath" property: 'C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe'
Querying compiler for default C++ language standard using command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -x c++ -E -dM nul
Custom configuration provider 'CMake Tools' registered
Detected language standard version: c++17
Querying compiler for default C language standard using command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -x c -E -dM nul
Detected language standard version: c11
Querying compiler's default target using command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -dumpmachine
Compiler returned default target value: Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.
x86_64-pc-windows-elf

Compiler query command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c11 -Wp,-v -E -dD -x c -m64 -fno-blocks nul
Code browsing service initialized
Attempting to get defaults from C++ compiler in "compilerPath" property: 'C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe'
Compiler query command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -m64 -fno-blocks nul
...
other: --ms_extensions
other: --clang
other: --clang_version=50002
stdver: c++17
intelliSenseMode: windows-clang-x64
...

Logs after trying to switch to "windows-gcc-x64":
[28.7.2021, 09:39:01] For C source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-clang-x64" based on compiler args and querying compilerPath: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe"
[28.7.2021, 09:39:03] For C++ source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-clang-x64" based on compiler args and querying compilerPath: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe"

With C/C++ Version 1.5.1 (every Version after 1.3.1)

Attempting to get defaults from C compiler in "compilerPath" property: 'C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe'
Querying compiler for default C++ language standard using command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -x c++ -E -dM nul
Detected language standard version: c++17
Querying compiler for default C language standard using command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -x c -E -dM nul
Detected language standard version: c11
Querying compiler's default target using command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -dumpmachine
Compiler returned default target value: Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.
x86_64-pc-windows-elf

Compiler query command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c11 -Wp,-v -E -dD -x c -m64 -fno-blocks nul
Code browsing service initialized
Attempting to get defaults from C++ compiler in "compilerPath" property: 'C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe'
Compiler query command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -m64 -fno-blocks nul
Custom configuration provider 'CMake Tools' registered
...
--->at this point "other: --ms_extensions" is missing <---
other: --clang
other: --clang_version=50002
stdver: c++17
intelliSenseMode: windows-clang-x64
...

@Colengms
Copy link
Collaborator

Hi @Helmta. If the compiler is detected as clang, the C/C++ extension currently detects whether ms-extensions is enabled by detecting a define emitted by the compiler: _MSC_EXTENSIONS. This define is required to be set when ms-extensions is enabled. (Though, it's specifically associated with C compilation. Does your compiler not support C compilation?). We do this because it's not necessary to pass -fms-extensions to enable the feature. It can also become enabled by default (depending on current platform) or enabled based on a specified target. (i.e. --target arg). It sounds like you using a clang-derived compiler that has either removed the associated define, or is ignoring the -fms-extension passed to it (either by default, or based on other arguments).

If your compiler supports C compilation, this would seem to be a bug with the compiler not specifying a define associated with the feature.

Could you provide the output of the following 2 commands? (or a diff of the defines it outputs?)

"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c11 -Wp,-v -E -dD -x c -fno-blocks nul
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fno-ms-extensions -std=c11 -Wp,-v -E -dD -x c -fno-blocks nul

I'm curious if that might provide some evidence of whether that compiler is recognizing the arg or ignoring it.

If the first one has _MSC_EXTENSIONS in the output, I'm curious if it get omitted by:

"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -fno-blocks nul

@Colengms Colengms self-assigned this Jul 28, 2021
@Colengms Colengms added Language Service more info needed The issue report is not actionable in its current state labels Jul 28, 2021
@Helmta
Copy link
Author

Helmta commented Jul 29, 2021

Hi,
thanks for the hint with the _MSC_EXTENSIONS.

"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c11 -Wp,-v -E -dD -x c -fno-blocks nul
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fno-ms-extensions -std=c11 -Wp,-v -E -dD -x c -fno-blocks nul
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -fno-blocks nul
do not have _MSC_EXTENSIONS in theirs outputs.

Ouputs of C are the same

Output

Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.
nul:
clang -cc1 version 5.0.2 based upon LLVM 5.0.2 default target i686-pc-windows-msvc
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\windows\vcl"
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\windows\rtl"
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\windows\sdk"
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\dinkumware64"
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\windows\crtl"
#include "..." search starts here:
#include <...> search starts here:
c:\prg\embarcadero\studio\20.0\include
c:\prg\embarcadero\studio\20.0\include\dinkumware64
C:\prg\Embarcadero\Studio\20.0\include\windows\crtl\de
c:\prg\embarcadero\studio\20.0\include\windows\crtl
C:\prg\Embarcadero\Studio\20.0\include\windows\rtl\de
c:\prg\embarcadero\studio\20.0\include\windows\rtl
c:\prg\embarcadero\studio\20.0\include\windows\vcl
c:\prg\embarcadero\studio\20.0\include\windows\sdk
c:\prg\embarcadero\studio\20.0\include\windows
End of search list.
# 1 "nul"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
#define llvm 1
#define clang 1
#define clang_major 5
#define clang_minor 0
#define clang_patchlevel 2
#define clang_version "5.0.2 (36933.9854b07.fc1c373)"
#define __ATOMIC_RELAXED 0
#define __ATOMIC_CONSUME 1
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_RELEASE 3
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_SEQ_CST 5
#define __PRAGMA_REDEFINE_EXTNAME 1
#define VERSION "4.2.1 Compatible Embarcadero Technologies Inc. bcc64 5.0.2 (36933.9854b07.fc1c373)"
#define STRICT_ANSI 1
#define __OBJC_BOOL_IS_BOOL 0
#define CONSTANT_CFSTRINGS 1
#define FUNC FUNCTION
#define ORDER_LITTLE_ENDIAN 1234
#define ORDER_BIG_ENDIAN 4321
#define ORDER_PDP_ENDIAN 3412
#define BYTE_ORDER ORDER_LITTLE_ENDIAN
#define LITTLE_ENDIAN 1
#define CHAR_BIT 8
#define SCHAR_MAX 127
#define SHRT_MAX 32767
#define INT_MAX 2147483647
#define LONG_MAX 2147483647L
#define LONG_LONG_MAX 9223372036854775807LL
#define WCHAR_MAX 65535
#define INTMAX_MAX 9223372036854775807LL
#define SIZE_MAX 18446744073709551615ULL
#define UINTMAX_MAX 18446744073709551615ULL
#define PTRDIFF_MAX 9223372036854775807LL
#define INTPTR_MAX 9223372036854775807LL
#define UINTPTR_MAX 18446744073709551615ULL
#define SIZEOF_DOUBLE 8
#define SIZEOF_FLOAT 4
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_DOUBLE 8
#define SIZEOF_LONG_LONG 8
#define SIZEOF_POINTER 8
#define SIZEOF_SHORT 2
#define SIZEOF_PTRDIFF_T 8
#define SIZEOF_SIZE_T 8
#define SIZEOF_WCHAR_T 2
#define SIZEOF_WINT_T 4
#define SIZEOF_INT128 16
#define INTMAX_TYPE long long int
#define INTMAX_FMTd "lld"
#define INTMAX_FMTi "lli"
#define INTMAX_C_SUFFIX LL
#define UINTMAX_TYPE long long unsigned int
#define UINTMAX_FMTo "llo"
#define UINTMAX_FMTu "llu"
#define UINTMAX_FMTx "llx"
#define UINTMAX_FMTX "llX"
#define UINTMAX_C_SUFFIX ULL
#define INTMAX_WIDTH 64
#define PTRDIFF_TYPE long long int
#define PTRDIFF_FMTd "lld"
#define PTRDIFF_FMTi "lli"
#define PTRDIFF_WIDTH 64
#define INTPTR_TYPE long long int
#define INTPTR_FMTd "lld"
#define INTPTR_FMTi "lli"
#define INTPTR_WIDTH 64
#define SIZE_TYPE long long unsigned int
#define SIZE_FMTo "llo"
#define SIZE_FMTu "llu"
#define SIZE_FMTx "llx"
#define SIZE_FMTX "llX"
#define SIZE_WIDTH 64
#define WCHAR_TYPE unsigned short
#define WCHAR_WIDTH 16
#define WINT_TYPE int
#define WINT_WIDTH 32
#define SIG_ATOMIC_WIDTH 32
#define SIG_ATOMIC_MAX 2147483647
#define CHAR16_TYPE unsigned short
#define CHAR32_TYPE unsigned int
#define UINTMAX_WIDTH 64
#define UINTPTR_TYPE long long unsigned int
#define UINTPTR_FMTo "llo"
#define UINTPTR_FMTu "llu"
#define UINTPTR_FMTx "llx"
#define UINTPTR_FMTX "llX"
#define UINTPTR_WIDTH 64
#define FLT_DENORM_MIN 1.40129846e-45F
#define FLT_HAS_DENORM 1
#define FLT_DIG 6
#define FLT_DECIMAL_DIG 9
#define FLT_EPSILON 1.19209290e-7F
#define FLT_HAS_INFINITY 1
#define FLT_HAS_QUIET_NAN 1
#define FLT_MANT_DIG 24
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 128
#define FLT_MAX 3.40282347e+38F
#define FLT_MIN_10_EXP (-37)
#define FLT_MIN_EXP (-125)
#define FLT_MIN 1.17549435e-38F
#define DBL_DENORM_MIN 4.9406564584124654e-324
#define DBL_HAS_DENORM 1
#define DBL_DIG 15
#define DBL_DECIMAL_DIG 17
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_HAS_INFINITY 1
#define DBL_HAS_QUIET_NAN 1
#define DBL_MANT_DIG 53
#define DBL_MAX_10_EXP 308
#define DBL_MAX_EXP 1024
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MIN_10_EXP (-307)
#define DBL_MIN_EXP (-1021)
#define DBL_MIN 2.2250738585072014e-308
#define LDBL_DENORM_MIN 4.9406564584124654e-324L
#define LDBL_HAS_DENORM 1
#define LDBL_DIG 15
#define LDBL_DECIMAL_DIG 17
#define LDBL_EPSILON 2.2204460492503131e-16L
#define LDBL_HAS_INFINITY 1
#define LDBL_HAS_QUIET_NAN 1
#define LDBL_MANT_DIG 53
#define LDBL_MAX_10_EXP 308
#define LDBL_MAX_EXP 1024
#define LDBL_MAX 1.7976931348623157e+308L
#define LDBL_MIN_10_EXP (-307)
#define LDBL_MIN_EXP (-1021)
#define LDBL_MIN 2.2250738585072014e-308L
#define POINTER_WIDTH 64
#define BIGGEST_ALIGNMENT 16
#define WCHAR_UNSIGNED 1
#define INT8_TYPE signed char
#define INT8_FMTd "hhd"
#define INT8_FMTi "hhi"
#define INT8_C_SUFFIX
#define INT16_TYPE short
#define INT16_FMTd "hd"
#define INT16_FMTi "hi"
#define INT16_C_SUFFIX
#define INT32_TYPE int
#define INT32_FMTd "d"
#define INT32_FMTi "i"
#define INT32_C_SUFFIX
#define INT64_TYPE long long int
#define INT64_FMTd "lld"
#define INT64_FMTi "lli"
#define INT64_C_SUFFIX LL
#define UINT8_TYPE unsigned char
#define UINT8_FMTo "hho"
#define UINT8_FMTu "hhu"
#define UINT8_FMTx "hhx"
#define UINT8_FMTX "hhX"
#define UINT8_C_SUFFIX
#define UINT8_MAX 255
#define INT8_MAX 127
#define UINT16_TYPE unsigned short
#define UINT16_FMTo "ho"
#define UINT16_FMTu "hu"
#define UINT16_FMTx "hx"
#define UINT16_FMTX "hX"
#define UINT16_C_SUFFIX
#define UINT16_MAX 65535
#define INT16_MAX 32767
#define UINT32_TYPE unsigned int
#define UINT32_FMTo "o"
#define UINT32_FMTu "u"
#define UINT32_FMTx "x"
#define UINT32_FMTX "X"
#define UINT32_C_SUFFIX U
#define UINT32_MAX 4294967295U
#define INT32_MAX 2147483647
#define UINT64_TYPE long long unsigned int
#define UINT64_FMTo "llo"
#define UINT64_FMTu "llu"
#define UINT64_FMTx "llx"
#define UINT64_FMTX "llX"
#define UINT64_C_SUFFIX ULL
#define UINT64_MAX 18446744073709551615ULL
#define INT64_MAX 9223372036854775807LL
#define INT_LEAST8_TYPE signed char
#define INT_LEAST8_MAX 127
#define INT_LEAST8_FMTd "hhd"
#define INT_LEAST8_FMTi "hhi"
#define UINT_LEAST8_TYPE unsigned char
#define UINT_LEAST8_MAX 255
#define UINT_LEAST8_FMTo "hho"
#define UINT_LEAST8_FMTu "hhu"
#define UINT_LEAST8_FMTx "hhx"
#define UINT_LEAST8_FMTX "hhX"
#define INT_LEAST16_TYPE short
#define INT_LEAST16_MAX 32767
#define INT_LEAST16_FMTd "hd"
#define INT_LEAST16_FMTi "hi"
#define UINT_LEAST16_TYPE unsigned short
#define UINT_LEAST16_MAX 65535
#define UINT_LEAST16_FMTo "ho"
#define UINT_LEAST16_FMTu "hu"
#define UINT_LEAST16_FMTx "hx"
#define UINT_LEAST16_FMTX "hX"
#define INT_LEAST32_TYPE int
#define INT_LEAST32_MAX 2147483647
#define INT_LEAST32_FMTd "d"
#define INT_LEAST32_FMTi "i"
#define UINT_LEAST32_TYPE unsigned int
#define UINT_LEAST32_MAX 4294967295U
#define UINT_LEAST32_FMTo "o"
#define UINT_LEAST32_FMTu "u"
#define UINT_LEAST32_FMTx "x"
#define UINT_LEAST32_FMTX "X"
#define INT_LEAST64_TYPE long long int
#define INT_LEAST64_MAX 9223372036854775807LL
#define INT_LEAST64_FMTd "lld"
#define INT_LEAST64_FMTi "lli"
#define UINT_LEAST64_TYPE long long unsigned int
#define UINT_LEAST64_MAX 18446744073709551615ULL
#define UINT_LEAST64_FMTo "llo"
#define UINT_LEAST64_FMTu "llu"
#define UINT_LEAST64_FMTx "llx"
#define UINT_LEAST64_FMTX "llX"
#define INT_FAST8_TYPE signed char
#define INT_FAST8_MAX 127
#define INT_FAST8_FMTd "hhd"
#define INT_FAST8_FMTi "hhi"
#define UINT_FAST8_TYPE unsigned char
#define UINT_FAST8_MAX 255
#define UINT_FAST8_FMTo "hho"
#define UINT_FAST8_FMTu "hhu"
#define UINT_FAST8_FMTx "hhx"
#define UINT_FAST8_FMTX "hhX"
#define INT_FAST16_TYPE short
#define INT_FAST16_MAX 32767
#define INT_FAST16_FMTd "hd"
#define INT_FAST16_FMTi "hi"
#define UINT_FAST16_TYPE unsigned short
#define UINT_FAST16_MAX 65535
#define UINT_FAST16_FMTo "ho"
#define UINT_FAST16_FMTu "hu"
#define UINT_FAST16_FMTx "hx"
#define UINT_FAST16_FMTX "hX"
#define INT_FAST32_TYPE int
#define INT_FAST32_MAX 2147483647
#define INT_FAST32_FMTd "d"
#define INT_FAST32_FMTi "i"
#define UINT_FAST32_TYPE unsigned int
#define UINT_FAST32_MAX 4294967295U
#define UINT_FAST32_FMTo "o"
#define UINT_FAST32_FMTu "u"
#define UINT_FAST32_FMTx "x"
#define UINT_FAST32_FMTX "X"
#define INT_FAST64_TYPE long long int
#define INT_FAST64_MAX 9223372036854775807LL
#define INT_FAST64_FMTd "lld"
#define INT_FAST64_FMTi "lli"
#define UINT_FAST64_TYPE long long unsigned int
#define UINT_FAST64_MAX 18446744073709551615ULL
#define UINT_FAST64_FMTo "llo"
#define UINT_FAST64_FMTu "llu"
#define UINT_FAST64_FMTx "llx"
#define UINT_FAST64_FMTX "llX"
#define USER_LABEL_PREFIX
#define FINITE_MATH_ONLY 0
#define GNUC_STDC_INLINE 1
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
#define __CLANG_ATOMIC_INT_LOCK_FREE 2
#define __CLANG_ATOMIC_LONG_LOCK_FREE 2
#define __CLANG_ATOMIC_LLONG_LOCK_FREE 2
#define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define NO_INLINE 1
#define PIC 1
#define pic 1
#define FLT_EVAL_METHOD 0
#define FLT_RADIX 2
#define DECIMAL_DIG LDBL_DECIMAL_DIG
#define amd64 1
#define __amd64 1
#define __x86_64 1
#define x86_64 1
#define __k8 1
#define k8 1
#define tune_k8 1
#define REGISTER_PREFIX
#define __NO_MATH_INLINES 1
#define FXSR 1
#define SSE2 1
#define SSE2_MATH 1
#define SSE 1
#define SSE_MATH 1
#define MMX 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define _WIN32 1
#define _WIN64 1
#define _PUSHPOP_SUPPORTED 1
#define FLAT 1
#define CODEGEARC 0x0740
#define BORLANDC 0x0740
#define TURBOC 0x0740
#define BCPLUSPLUS 0x0740
#define TCPLUSPLUS 0x0740
#define UUID_SUPPORT 1
#define CODEGEARC_VERSION 0x07408ECC
#define _Windows 1
#define _INTEGRAL_MAX_BITS 64
#define _M_X64 1
#define _M_AMD64 1
#define STDC_HOSTED 1
#define STDC_VERSION 201112L
#define STDC_UTF_16 1
#define STDC_UTF_32 1

# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "nul" 2

Output of C++
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -fno-blocks nul

Output

Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.
nul:
clang -cc1 version 5.0.2 based upon LLVM 5.0.2 default target i686-pc-windows-msvc
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\windows\vcl"
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\windows\rtl"
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\windows\sdk"
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\dinkumware64"
ignoring duplicate directory "c:\prg\embarcadero\studio\20.0\include\windows\crtl"
#include "..." search starts here:
#include <...> search starts here:
c:\prg\embarcadero\studio\20.0\include
c:\prg\embarcadero\studio\20.0\include\dinkumware64
C:\prg\Embarcadero\Studio\20.0\include\windows\crtl\de
c:\prg\embarcadero\studio\20.0\include\windows\crtl
C:\prg\Embarcadero\Studio\20.0\include\windows\rtl\de
c:\prg\embarcadero\studio\20.0\include\windows\rtl
c:\prg\embarcadero\studio\20.0\include\windows\vcl
c:\prg\embarcadero\studio\20.0\include\windows\sdk
c:\prg\embarcadero\studio\20.0\include\windows
End of search list.
# 1 "nul"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
#define llvm 1
#define clang 1
#define clang_major 5
#define clang_minor 0
#define clang_patchlevel 2
#define clang_version "5.0.2 (36933.9854b07.fc1c373)"
#define __ATOMIC_RELAXED 0
#define __ATOMIC_CONSUME 1
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_RELEASE 3
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_SEQ_CST 5
#define __PRAGMA_REDEFINE_EXTNAME 1
#define VERSION "4.2.1 Compatible Embarcadero Technologies Inc. bcc64 5.0.2 (36933.9854b07.fc1c373)"
#define STRICT_ANSI 1
#define GXX_EXPERIMENTAL_CXX0X 1
#define __OBJC_BOOL_IS_BOOL 0
#define __cpp_rtti 199711
#define __cpp_exceptions 199711
#define __cpp_unicode_characters 200704
#define __cpp_raw_strings 200710
#define __cpp_unicode_literals 200710
#define __cpp_user_defined_literals 200809
#define __cpp_lambdas 200907
#define __cpp_constexpr 201603
#define __cpp_range_based_for 201603
#define __cpp_static_assert 201411
#define __cpp_decltype 200707
#define __cpp_attributes 200809
#define __cpp_rvalue_references 200610
#define __cpp_variadic_templates 200704
#define __cpp_initializer_lists 200806
#define __cpp_delegating_constructors 200604
#define __cpp_nsdmi 200809
#define __cpp_inheriting_constructors 201511
#define __cpp_ref_qualifiers 200710
#define __cpp_alias_templates 200704
#define __cpp_binary_literals 201304
#define __cpp_digit_separators 201309
#define __cpp_init_captures 201304
#define __cpp_generic_lambdas 201304
#define __cpp_decltype_auto 201304
#define __cpp_return_type_deduction 201304
#define __cpp_aggregate_nsdmi 201304
#define __cpp_variable_templates 201304
#define __cpp_hex_float 201603
#define __cpp_inline_variables 201606
#define __cpp_noexcept_function_type 201510
#define __cpp_capture_star_this 201603
#define __cpp_if_constexpr 201606
#define __cpp_deduction_guides 201611
#define __cpp_template_auto 201606
#define __cpp_namespace_attributes 201411
#define __cpp_enumerator_attributes 201411
#define __cpp_nested_namespace_definitions 201411
#define __cpp_variadic_using 201611
#define __cpp_aggregate_bases 201603
#define __cpp_structured_bindings 201606
#define __cpp_nontype_template_args 201411
#define __cpp_fold_expressions 201603
#define __cpp_aligned_new 201606
#define CONSTANT_CFSTRINGS 1
#define __EXCEPTIONS 1
#define __GXX_RTTI 1
#define __DEPRECATED 1
#define _WCHAR_T_DEFINED 1
#define _NATIVE_WCHAR_T_DEFINED 1
#define FUNC FUNCTION
#define ORDER_LITTLE_ENDIAN 1234
#define ORDER_BIG_ENDIAN 4321
#define ORDER_PDP_ENDIAN 3412
#define BYTE_ORDER ORDER_LITTLE_ENDIAN
#define LITTLE_ENDIAN 1
#define CHAR_BIT 8
#define SCHAR_MAX 127
#define SHRT_MAX 32767
#define INT_MAX 2147483647
#define LONG_MAX 2147483647L
#define LONG_LONG_MAX 9223372036854775807LL
#define WCHAR_MAX 65535
#define INTMAX_MAX 9223372036854775807LL
#define SIZE_MAX 18446744073709551615ULL
#define UINTMAX_MAX 18446744073709551615ULL
#define PTRDIFF_MAX 9223372036854775807LL
#define INTPTR_MAX 9223372036854775807LL
#define UINTPTR_MAX 18446744073709551615ULL
#define SIZEOF_DOUBLE 8
#define SIZEOF_FLOAT 4
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_DOUBLE 8
#define SIZEOF_LONG_LONG 8
#define SIZEOF_POINTER 8
#define SIZEOF_SHORT 2
#define SIZEOF_PTRDIFF_T 8
#define SIZEOF_SIZE_T 8
#define SIZEOF_WCHAR_T 2
#define SIZEOF_WINT_T 4
#define SIZEOF_INT128 16
#define INTMAX_TYPE long long int
#define INTMAX_FMTd "lld"
#define INTMAX_FMTi "lli"
#define INTMAX_C_SUFFIX LL
#define UINTMAX_TYPE long long unsigned int
#define UINTMAX_FMTo "llo"
#define UINTMAX_FMTu "llu"
#define UINTMAX_FMTx "llx"
#define UINTMAX_FMTX "llX"
#define UINTMAX_C_SUFFIX ULL
#define INTMAX_WIDTH 64
#define PTRDIFF_TYPE long long int
#define PTRDIFF_FMTd "lld"
#define PTRDIFF_FMTi "lli"
#define PTRDIFF_WIDTH 64
#define INTPTR_TYPE long long int
#define INTPTR_FMTd "lld"
#define INTPTR_FMTi "lli"
#define INTPTR_WIDTH 64
#define SIZE_TYPE long long unsigned int
#define SIZE_FMTo "llo"
#define SIZE_FMTu "llu"
#define SIZE_FMTx "llx"
#define SIZE_FMTX "llX"
#define SIZE_WIDTH 64
#define WCHAR_TYPE unsigned short
#define WCHAR_WIDTH 16
#define WINT_TYPE int
#define WINT_WIDTH 32
#define SIG_ATOMIC_WIDTH 32
#define SIG_ATOMIC_MAX 2147483647
#define CHAR16_TYPE unsigned short
#define CHAR32_TYPE unsigned int
#define UINTMAX_WIDTH 64
#define UINTPTR_TYPE long long unsigned int
#define UINTPTR_FMTo "llo"
#define UINTPTR_FMTu "llu"
#define UINTPTR_FMTx "llx"
#define UINTPTR_FMTX "llX"
#define UINTPTR_WIDTH 64
#define FLT_DENORM_MIN 1.40129846e-45F
#define FLT_HAS_DENORM 1
#define FLT_DIG 6
#define FLT_DECIMAL_DIG 9
#define FLT_EPSILON 1.19209290e-7F
#define FLT_HAS_INFINITY 1
#define FLT_HAS_QUIET_NAN 1
#define FLT_MANT_DIG 24
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 128
#define FLT_MAX 3.40282347e+38F
#define FLT_MIN_10_EXP (-37)
#define FLT_MIN_EXP (-125)
#define FLT_MIN 1.17549435e-38F
#define DBL_DENORM_MIN 4.9406564584124654e-324
#define DBL_HAS_DENORM 1
#define DBL_DIG 15
#define DBL_DECIMAL_DIG 17
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_HAS_INFINITY 1
#define DBL_HAS_QUIET_NAN 1
#define DBL_MANT_DIG 53
#define DBL_MAX_10_EXP 308
#define DBL_MAX_EXP 1024
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MIN_10_EXP (-307)
#define DBL_MIN_EXP (-1021)
#define DBL_MIN 2.2250738585072014e-308
#define LDBL_DENORM_MIN 4.9406564584124654e-324L
#define LDBL_HAS_DENORM 1
#define LDBL_DIG 15
#define LDBL_DECIMAL_DIG 17
#define LDBL_EPSILON 2.2204460492503131e-16L
#define LDBL_HAS_INFINITY 1
#define LDBL_HAS_QUIET_NAN 1
#define LDBL_MANT_DIG 53
#define LDBL_MAX_10_EXP 308
#define LDBL_MAX_EXP 1024
#define LDBL_MAX 1.7976931348623157e+308L
#define LDBL_MIN_10_EXP (-307)
#define LDBL_MIN_EXP (-1021)
#define LDBL_MIN 2.2250738585072014e-308L
#define POINTER_WIDTH 64
#define BIGGEST_ALIGNMENT 16
#define WCHAR_UNSIGNED 1
#define INT8_TYPE signed char
#define INT8_FMTd "hhd"
#define INT8_FMTi "hhi"
#define INT8_C_SUFFIX
#define INT16_TYPE short
#define INT16_FMTd "hd"
#define INT16_FMTi "hi"
#define INT16_C_SUFFIX
#define INT32_TYPE int
#define INT32_FMTd "d"
#define INT32_FMTi "i"
#define INT32_C_SUFFIX
#define INT64_TYPE long long int
#define INT64_FMTd "lld"
#define INT64_FMTi "lli"
#define INT64_C_SUFFIX LL
#define UINT8_TYPE unsigned char
#define UINT8_FMTo "hho"
#define UINT8_FMTu "hhu"
#define UINT8_FMTx "hhx"
#define UINT8_FMTX "hhX"
#define UINT8_C_SUFFIX
#define UINT8_MAX 255
#define INT8_MAX 127
#define UINT16_TYPE unsigned short
#define UINT16_FMTo "ho"
#define UINT16_FMTu "hu"
#define UINT16_FMTx "hx"
#define UINT16_FMTX "hX"
#define UINT16_C_SUFFIX
#define UINT16_MAX 65535
#define INT16_MAX 32767
#define UINT32_TYPE unsigned int
#define UINT32_FMTo "o"
#define UINT32_FMTu "u"
#define UINT32_FMTx "x"
#define UINT32_FMTX "X"
#define UINT32_C_SUFFIX U
#define UINT32_MAX 4294967295U
#define INT32_MAX 2147483647
#define UINT64_TYPE long long unsigned int
#define UINT64_FMTo "llo"
#define UINT64_FMTu "llu"
#define UINT64_FMTx "llx"
#define UINT64_FMTX "llX"
#define UINT64_C_SUFFIX ULL
#define UINT64_MAX 18446744073709551615ULL
#define INT64_MAX 9223372036854775807LL
#define INT_LEAST8_TYPE signed char
#define INT_LEAST8_MAX 127
#define INT_LEAST8_FMTd "hhd"
#define INT_LEAST8_FMTi "hhi"
#define UINT_LEAST8_TYPE unsigned char
#define UINT_LEAST8_MAX 255
#define UINT_LEAST8_FMTo "hho"
#define UINT_LEAST8_FMTu "hhu"
#define UINT_LEAST8_FMTx "hhx"
#define UINT_LEAST8_FMTX "hhX"
#define INT_LEAST16_TYPE short
#define INT_LEAST16_MAX 32767
#define INT_LEAST16_FMTd "hd"
#define INT_LEAST16_FMTi "hi"
#define UINT_LEAST16_TYPE unsigned short
#define UINT_LEAST16_MAX 65535
#define UINT_LEAST16_FMTo "ho"
#define UINT_LEAST16_FMTu "hu"
#define UINT_LEAST16_FMTx "hx"
#define UINT_LEAST16_FMTX "hX"
#define INT_LEAST32_TYPE int
#define INT_LEAST32_MAX 2147483647
#define INT_LEAST32_FMTd "d"
#define INT_LEAST32_FMTi "i"
#define UINT_LEAST32_TYPE unsigned int
#define UINT_LEAST32_MAX 4294967295U
#define UINT_LEAST32_FMTo "o"
#define UINT_LEAST32_FMTu "u"
#define UINT_LEAST32_FMTx "x"
#define UINT_LEAST32_FMTX "X"
#define INT_LEAST64_TYPE long long int
#define INT_LEAST64_MAX 9223372036854775807LL
#define INT_LEAST64_FMTd "lld"
#define INT_LEAST64_FMTi "lli"
#define UINT_LEAST64_TYPE long long unsigned int
#define UINT_LEAST64_MAX 18446744073709551615ULL
#define UINT_LEAST64_FMTo "llo"
#define UINT_LEAST64_FMTu "llu"
#define UINT_LEAST64_FMTx "llx"
#define UINT_LEAST64_FMTX "llX"
#define INT_FAST8_TYPE signed char
#define INT_FAST8_MAX 127
#define INT_FAST8_FMTd "hhd"
#define INT_FAST8_FMTi "hhi"
#define UINT_FAST8_TYPE unsigned char
#define UINT_FAST8_MAX 255
#define UINT_FAST8_FMTo "hho"
#define UINT_FAST8_FMTu "hhu"
#define UINT_FAST8_FMTx "hhx"
#define UINT_FAST8_FMTX "hhX"
#define INT_FAST16_TYPE short
#define INT_FAST16_MAX 32767
#define INT_FAST16_FMTd "hd"
#define INT_FAST16_FMTi "hi"
#define UINT_FAST16_TYPE unsigned short
#define UINT_FAST16_MAX 65535
#define UINT_FAST16_FMTo "ho"
#define UINT_FAST16_FMTu "hu"
#define UINT_FAST16_FMTx "hx"
#define UINT_FAST16_FMTX "hX"
#define INT_FAST32_TYPE int
#define INT_FAST32_MAX 2147483647
#define INT_FAST32_FMTd "d"
#define INT_FAST32_FMTi "i"
#define UINT_FAST32_TYPE unsigned int
#define UINT_FAST32_MAX 4294967295U
#define UINT_FAST32_FMTo "o"
#define UINT_FAST32_FMTu "u"
#define UINT_FAST32_FMTx "x"
#define UINT_FAST32_FMTX "X"
#define INT_FAST64_TYPE long long int
#define INT_FAST64_MAX 9223372036854775807LL
#define INT_FAST64_FMTd "lld"
#define INT_FAST64_FMTi "lli"
#define UINT_FAST64_TYPE long long unsigned int
#define UINT_FAST64_MAX 18446744073709551615ULL
#define UINT_FAST64_FMTo "llo"
#define UINT_FAST64_FMTu "llu"
#define UINT_FAST64_FMTx "llx"
#define UINT_FAST64_FMTX "llX"
#define USER_LABEL_PREFIX
#define FINITE_MATH_ONLY 0
#define GNUC_GNU_INLINE 1
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
#define __CLANG_ATOMIC_INT_LOCK_FREE 2
#define __CLANG_ATOMIC_LONG_LOCK_FREE 2
#define __CLANG_ATOMIC_LLONG_LOCK_FREE 2
#define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define NO_INLINE 1
#define PIC 1
#define pic 1
#define FLT_EVAL_METHOD 0
#define FLT_RADIX 2
#define DECIMAL_DIG LDBL_DECIMAL_DIG
#define amd64 1
#define __amd64 1
#define __x86_64 1
#define x86_64 1
#define __k8 1
#define k8 1
#define tune_k8 1
#define REGISTER_PREFIX
#define __NO_MATH_INLINES 1
#define FXSR 1
#define SSE2 1
#define SSE2_MATH 1
#define SSE 1
#define SSE_MATH 1
#define MMX 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define _WIN32 1
#define _WIN64 1
#define _CPPUNWIND 1
#define _PUSHPOP_SUPPORTED 1
#define FLAT 1
#define CODEGEARC 0x0740
#define BORLANDC 0x0740
#define TURBOC 0x0740
#define BCPLUSPLUS 0x0740
#define TCPLUSPLUS 0x0740
#define UUID_SUPPORT 1
#define CODEGEARC_VERSION 0x07408ECC
#define _Windows 1
#define _INTEGRAL_MAX_BITS 64
#define _M_X64 1
#define _M_AMD64 1
#define STDC_HOSTED 1
#define __cplusplus 201703L
#define STDCPP_DEFAULT_NEW_ALIGNMENT 8ULL
#define STDC_UTF_16 1
#define STDC_UTF_32 1

# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "nul" 2

You can see the line
clang -cc1 version 5.0.2 based upon LLVM 5.0.2 default target i686-pc-windows-msvc
in the output.

So I played a bit with the commenadline args. Especially the -target option was interesting.

"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -target=x86_64-pc-win32-elf -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -fno-blocks nul
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" "-triple x86_64-pc-win32-elf" -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -fno-blocks nul
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -triple=x86_64-pc-win32-elf -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -fno-blocks nul
has the same output as
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -fno-blocks nul

The only way i found to get the _MSC_EXTENSIONS defined is with -cc1 option and -fms-extensions
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -cc1 -fms-extensions -std=c++17 -E -dD -x c++ nul

Output

# 1 "nul"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
#define llvm 1
#define clang 1
#define clang_major 5
#define clang_minor 0
#define clang_patchlevel 2
#define clang_version "5.0.2 (36933.9854b07.fc1c373)"
#define GNUC_MINOR 2
#define GNUC_PATCHLEVEL 1
#define GNUC 4
#define __GXX_ABI_VERSION 1002
#define __ATOMIC_RELAXED 0
#define __ATOMIC_CONSUME 1
#define __ATOMIC_ACQUIRE 2
#define __ATOMIC_RELEASE 3
#define __ATOMIC_ACQ_REL 4
#define __ATOMIC_SEQ_CST 5
#define __PRAGMA_REDEFINE_EXTNAME 1
#define VERSION "4.2.1 Compatible Embarcadero Technologies Inc. bcc64 5.0.2 (36933.9854b07.fc1c373)"
#define STRICT_ANSI 1
#define GXX_EXPERIMENTAL_CXX0X 1
#define __OBJC_BOOL_IS_BOOL 0
#define __cpp_rtti 199711
#define __cpp_unicode_characters 200704
#define __cpp_raw_strings 200710
#define __cpp_unicode_literals 200710
#define __cpp_user_defined_literals 200809
#define __cpp_lambdas 200907
#define __cpp_constexpr 201603
#define __cpp_range_based_for 201603
#define __cpp_static_assert 201411
#define __cpp_decltype 200707
#define __cpp_attributes 200809
#define __cpp_rvalue_references 200610
#define __cpp_variadic_templates 200704
#define __cpp_initializer_lists 200806
#define __cpp_delegating_constructors 200604
#define __cpp_nsdmi 200809
#define __cpp_inheriting_constructors 201511
#define __cpp_ref_qualifiers 200710
#define __cpp_alias_templates 200704
#define __cpp_threadsafe_static_init 200806
#define __cpp_binary_literals 201304
#define __cpp_digit_separators 201309
#define __cpp_init_captures 201304
#define __cpp_generic_lambdas 201304
#define __cpp_decltype_auto 201304
#define __cpp_return_type_deduction 201304
#define __cpp_aggregate_nsdmi 201304
#define __cpp_variable_templates 201304
#define __cpp_hex_float 201603
#define __cpp_inline_variables 201606
#define __cpp_noexcept_function_type 201510
#define __cpp_capture_star_this 201603
#define __cpp_if_constexpr 201606
#define __cpp_deduction_guides 201611
#define __cpp_template_auto 201606
#define __cpp_namespace_attributes 201411
#define __cpp_enumerator_attributes 201411
#define __cpp_nested_namespace_definitions 201411
#define __cpp_variadic_using 201611
#define __cpp_aggregate_bases 201603
#define __cpp_structured_bindings 201606
#define __cpp_nontype_template_args 201411
#define __cpp_fold_expressions 201603
#define __cpp_aligned_new 201606
#define CONSTANT_CFSTRINGS 1
#define __GXX_RTTI 1
#define GNUG 4
#define GXX_WEAK 1
#define private_extern extern
#define _WCHAR_T_DEFINED 1
#define _NATIVE_WCHAR_T_DEFINED 1
#define ORDER_LITTLE_ENDIAN 1234
#define ORDER_BIG_ENDIAN 4321
#define ORDER_PDP_ENDIAN 3412
#define BYTE_ORDER ORDER_LITTLE_ENDIAN
#define LITTLE_ENDIAN 1
#define _ILP32 1
#define ILP32 1
#define CHAR_BIT 8
#define SCHAR_MAX 127
#define SHRT_MAX 32767
#define INT_MAX 2147483647
#define LONG_MAX 2147483647L
#define LONG_LONG_MAX 9223372036854775807LL
#define WCHAR_MAX 65535
#define INTMAX_MAX 9223372036854775807LL
#define SIZE_MAX 4294967295U
#define UINTMAX_MAX 18446744073709551615ULL
#define PTRDIFF_MAX 2147483647
#define INTPTR_MAX 2147483647
#define UINTPTR_MAX 4294967295U
#define SIZEOF_DOUBLE 8
#define SIZEOF_FLOAT 4
#define SIZEOF_INT 4
#define SIZEOF_LONG 4
#define SIZEOF_LONG_DOUBLE 8
#define SIZEOF_LONG_LONG 8
#define SIZEOF_POINTER 4
#define SIZEOF_SHORT 2
#define SIZEOF_PTRDIFF_T 4
#define SIZEOF_SIZE_T 4
#define SIZEOF_WCHAR_T 2
#define SIZEOF_WINT_T 4
#define INTMAX_TYPE long long int
#define INTMAX_FMTd "lld"
#define INTMAX_FMTi "lli"
#define INTMAX_C_SUFFIX LL
#define UINTMAX_TYPE long long unsigned int
#define UINTMAX_FMTo "llo"
#define UINTMAX_FMTu "llu"
#define UINTMAX_FMTx "llx"
#define UINTMAX_FMTX "llX"
#define UINTMAX_C_SUFFIX ULL
#define INTMAX_WIDTH 64
#define PTRDIFF_TYPE int
#define PTRDIFF_FMTd "d"
#define PTRDIFF_FMTi "i"
#define PTRDIFF_WIDTH 32
#define INTPTR_TYPE int
#define INTPTR_FMTd "d"
#define INTPTR_FMTi "i"
#define INTPTR_WIDTH 32
#define SIZE_TYPE unsigned int
#define SIZE_FMTo "o"
#define SIZE_FMTu "u"
#define SIZE_FMTx "x"
#define SIZE_FMTX "X"
#define SIZE_WIDTH 32
#define WCHAR_TYPE unsigned short
#define WCHAR_WIDTH 16
#define WINT_TYPE int
#define WINT_WIDTH 32
#define SIG_ATOMIC_WIDTH 32
#define SIG_ATOMIC_MAX 2147483647
#define CHAR16_TYPE unsigned short
#define CHAR32_TYPE unsigned int
#define UINTMAX_WIDTH 64
#define UINTPTR_TYPE unsigned int
#define UINTPTR_FMTo "o"
#define UINTPTR_FMTu "u"
#define UINTPTR_FMTx "x"
#define UINTPTR_FMTX "X"
#define UINTPTR_WIDTH 32
#define FLT_DENORM_MIN 1.40129846e-45F
#define FLT_HAS_DENORM 1
#define FLT_DIG 6
#define FLT_DECIMAL_DIG 9
#define FLT_EPSILON 1.19209290e-7F
#define FLT_HAS_INFINITY 1
#define FLT_HAS_QUIET_NAN 1
#define FLT_MANT_DIG 24
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 128
#define FLT_MAX 3.40282347e+38F
#define FLT_MIN_10_EXP (-37)
#define FLT_MIN_EXP (-125)
#define FLT_MIN 1.17549435e-38F
#define DBL_DENORM_MIN 4.9406564584124654e-324
#define DBL_HAS_DENORM 1
#define DBL_DIG 15
#define DBL_DECIMAL_DIG 17
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_HAS_INFINITY 1
#define DBL_HAS_QUIET_NAN 1
#define DBL_MANT_DIG 53
#define DBL_MAX_10_EXP 308
#define DBL_MAX_EXP 1024
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MIN_10_EXP (-307)
#define DBL_MIN_EXP (-1021)
#define DBL_MIN 2.2250738585072014e-308
#define LDBL_DENORM_MIN 4.9406564584124654e-324L
#define LDBL_HAS_DENORM 1
#define LDBL_DIG 15
#define LDBL_DECIMAL_DIG 17
#define LDBL_EPSILON 2.2204460492503131e-16L
#define LDBL_HAS_INFINITY 1
#define LDBL_HAS_QUIET_NAN 1
#define LDBL_MANT_DIG 53
#define LDBL_MAX_10_EXP 308
#define LDBL_MAX_EXP 1024
#define LDBL_MAX 1.7976931348623157e+308L
#define LDBL_MIN_10_EXP (-307)
#define LDBL_MIN_EXP (-1021)
#define LDBL_MIN 2.2250738585072014e-308L
#define POINTER_WIDTH 32
#define BIGGEST_ALIGNMENT 16
#define WCHAR_UNSIGNED 1
#define INT8_TYPE signed char
#define INT8_FMTd "hhd"
#define INT8_FMTi "hhi"
#define INT8_C_SUFFIX
#define INT16_TYPE short
#define INT16_FMTd "hd"
#define INT16_FMTi "hi"
#define INT16_C_SUFFIX
#define INT32_TYPE int
#define INT32_FMTd "d"
#define INT32_FMTi "i"
#define INT32_C_SUFFIX
#define INT64_TYPE long long int
#define INT64_FMTd "lld"
#define INT64_FMTi "lli"
#define INT64_C_SUFFIX LL
#define UINT8_TYPE unsigned char
#define UINT8_FMTo "hho"
#define UINT8_FMTu "hhu"
#define UINT8_FMTx "hhx"
#define UINT8_FMTX "hhX"
#define UINT8_C_SUFFIX
#define UINT8_MAX 255
#define INT8_MAX 127
#define UINT16_TYPE unsigned short
#define UINT16_FMTo "ho"
#define UINT16_FMTu "hu"
#define UINT16_FMTx "hx"
#define UINT16_FMTX "hX"
#define UINT16_C_SUFFIX
#define UINT16_MAX 65535
#define INT16_MAX 32767
#define UINT32_TYPE unsigned int
#define UINT32_FMTo "o"
#define UINT32_FMTu "u"
#define UINT32_FMTx "x"
#define UINT32_FMTX "X"
#define UINT32_C_SUFFIX U
#define UINT32_MAX 4294967295U
#define INT32_MAX 2147483647
#define UINT64_TYPE long long unsigned int
#define UINT64_FMTo "llo"
#define UINT64_FMTu "llu"
#define UINT64_FMTx "llx"
#define UINT64_FMTX "llX"
#define UINT64_C_SUFFIX ULL
#define UINT64_MAX 18446744073709551615ULL
#define INT64_MAX 9223372036854775807LL
#define INT_LEAST8_TYPE signed char
#define INT_LEAST8_MAX 127
#define INT_LEAST8_FMTd "hhd"
#define INT_LEAST8_FMTi "hhi"
#define UINT_LEAST8_TYPE unsigned char
#define UINT_LEAST8_MAX 255
#define UINT_LEAST8_FMTo "hho"
#define UINT_LEAST8_FMTu "hhu"
#define UINT_LEAST8_FMTx "hhx"
#define UINT_LEAST8_FMTX "hhX"
#define INT_LEAST16_TYPE short
#define INT_LEAST16_MAX 32767
#define INT_LEAST16_FMTd "hd"
#define INT_LEAST16_FMTi "hi"
#define UINT_LEAST16_TYPE unsigned short
#define UINT_LEAST16_MAX 65535
#define UINT_LEAST16_FMTo "ho"
#define UINT_LEAST16_FMTu "hu"
#define UINT_LEAST16_FMTx "hx"
#define UINT_LEAST16_FMTX "hX"
#define INT_LEAST32_TYPE int
#define INT_LEAST32_MAX 2147483647
#define INT_LEAST32_FMTd "d"
#define INT_LEAST32_FMTi "i"
#define UINT_LEAST32_TYPE unsigned int
#define UINT_LEAST32_MAX 4294967295U
#define UINT_LEAST32_FMTo "o"
#define UINT_LEAST32_FMTu "u"
#define UINT_LEAST32_FMTx "x"
#define UINT_LEAST32_FMTX "X"
#define INT_LEAST64_TYPE long long int
#define INT_LEAST64_MAX 9223372036854775807LL
#define INT_LEAST64_FMTd "lld"
#define INT_LEAST64_FMTi "lli"
#define UINT_LEAST64_TYPE long long unsigned int
#define UINT_LEAST64_MAX 18446744073709551615ULL
#define UINT_LEAST64_FMTo "llo"
#define UINT_LEAST64_FMTu "llu"
#define UINT_LEAST64_FMTx "llx"
#define UINT_LEAST64_FMTX "llX"
#define INT_FAST8_TYPE signed char
#define INT_FAST8_MAX 127
#define INT_FAST8_FMTd "hhd"
#define INT_FAST8_FMTi "hhi"
#define UINT_FAST8_TYPE unsigned char
#define UINT_FAST8_MAX 255
#define UINT_FAST8_FMTo "hho"
#define UINT_FAST8_FMTu "hhu"
#define UINT_FAST8_FMTx "hhx"
#define UINT_FAST8_FMTX "hhX"
#define INT_FAST16_TYPE short
#define INT_FAST16_MAX 32767
#define INT_FAST16_FMTd "hd"
#define INT_FAST16_FMTi "hi"
#define UINT_FAST16_TYPE unsigned short
#define UINT_FAST16_MAX 65535
#define UINT_FAST16_FMTo "ho"
#define UINT_FAST16_FMTu "hu"
#define UINT_FAST16_FMTx "hx"
#define UINT_FAST16_FMTX "hX"
#define INT_FAST32_TYPE int
#define INT_FAST32_MAX 2147483647
#define INT_FAST32_FMTd "d"
#define INT_FAST32_FMTi "i"
#define UINT_FAST32_TYPE unsigned int
#define UINT_FAST32_MAX 4294967295U
#define UINT_FAST32_FMTo "o"
#define UINT_FAST32_FMTu "u"
#define UINT_FAST32_FMTx "x"
#define UINT_FAST32_FMTX "X"
#define INT_FAST64_TYPE long long int
#define INT_FAST64_MAX 9223372036854775807LL
#define INT_FAST64_FMTd "lld"
#define INT_FAST64_FMTi "lli"
#define UINT_FAST64_TYPE long long unsigned int
#define UINT_FAST64_MAX 18446744073709551615ULL
#define UINT_FAST64_FMTo "llo"
#define UINT_FAST64_FMTu "llu"
#define UINT_FAST64_FMTx "llx"
#define UINT_FAST64_FMTX "llX"
#define USER_LABEL_PREFIX _
#define FINITE_MATH_ONLY 0
#define GNUC_GNU_INLINE 1
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
#define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
#define __CLANG_ATOMIC_INT_LOCK_FREE 2
#define __CLANG_ATOMIC_LONG_LOCK_FREE 2
#define __CLANG_ATOMIC_LLONG_LOCK_FREE 2
#define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define NO_INLINE 1
#define FLT_EVAL_METHOD 2
#define FLT_RADIX 2
#define DECIMAL_DIG LDBL_DECIMAL_DIG
#define __i386 1
#define i386 1
#define REGISTER_PREFIX
#define __NO_MATH_INLINES 1
#define _M_IX86_FP 0
#define _WIN32 1
#define _CPPRTTI 1
#define __BOOL_DEFINED 1
#define _MSC_EXTENSIONS 1
#define _RVALUE_REFERENCES_V2_SUPPORTED 1
#define _RVALUE_REFERENCES_SUPPORTED 1
#define _NATIVE_NULLPTR_SUPPORTED 1
#define _INTEGRAL_MAX_BITS 64
#define _M_IX86 600
#define STDC 1
#define STDC_HOSTED 1
#define __cplusplus 201703L
#define STDCPP_DEFAULT_NEW_ALIGNMENT 8U
#define STDC_UTF_16 1
#define STDC_UTF_32 1

# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "nul" 2

Then i have to set the target with -triple <value>
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -cc1 -triple x86_64-pc-win32-elf -fms-extensions -std=c++17 -E -dD -x c++ nul

So I tried to set -cc1 in the settings but it is ignored.

Settings

"C_Cpp.default.compilerPath": "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe",
"C_Cpp.default.compilerArgs": [
"-cc1",
"-triple x86_64-pc-win32-elf",
"-fborland-extensions",
"-fexceptions",
"-fms-extensions"
],

Error

Attempting to get defaults from C++ compiler in "compilerPath" property: 'C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe'
Compiler query command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -triple x86_64-pc-win32-elf -fborland-extensions -fexceptions -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -m64 -fno-blocks nul
Failed to query compiler. Falling back to 32-bit intelliSenseMode.
Compiler query command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -triple x86_64-pc-win32-elf -fborland-extensions -fexceptions -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -m32 -fno-blocks nul
Failed to query compiler. Falling back to no bitness.
Compiler query command line: "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -triple x86_64-pc-win32-elf -fborland-extensions -fexceptions -fms-extensions -std=c++17 -Wp,-v -E -dD -x c++ -fno-blocks nul
bcc64.exe: error: no such file or directory: 'x86_64-pc-win32-elf'

or

Settings

"C_Cpp.default.compilerPath": "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe -cc1 -triple x86_64-pc-win32-elf -fms-extensions",

Error

Attempting to get defaults from C++ compiler in "compilerPath" property: 'C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe'
No suitable compiler found.

With
"C_Cpp.default.compilerPath": "C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe -cc1 -fms-extensions",
-cc1 and -fms-extensions are just ignored.

Extra Information

C:\WINDOWS\system32>bcc64 -cc1 -version
LLVM (http://llvm.org/):
LLVM version 5.0.2
DEBUG build.
Default target: i686-pc-windows-msvc
Host CPU: skylake

C:\WINDOWS\system32>bcc64 --version
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.
Embarcadero Technologies Inc. bcc64 version 5.0.2 (36933.9854b07.fc1c373) (based on LLVM 5.0.2)
Target: x86_64-pc-windows-elf
Thread model: posix
InstalledDir: C:\prg\Embarcadero\Studio\20.0\bin

stripped commandline with all args the original GUI is invoking
"C:/prg/Embarcadero/Studio/20.0/bin/bcc64.exe" -cc1 -dwarf-version=2 -fborland-extensions -fdiagnostics-format borland -nobuiltininc -nostdsysteminc -triple x86_64-pc-win32-elf -emit-obj -fexceptions -fcxx-exceptions -fseh -munwind-tables -fno-common -fno-spell-checking -fno-use-cxa-atexit -x c++ -std=c++17 -O2 -fmath-errno -tR -tD -tM -tU -PD -sys-header-deps -E -dD -x c++ nul
This does not define _MSC_EXTENSIONS either. But it works and cmake does the job too even without the -cc1 option.

@Colengms
Copy link
Collaborator

Hi @Helmta . Does your code include uses of MS extensions that fail to compile when -fms-extensions is not specified? If so, I believe we can fix this by falling back to checking the compiler argument if the define is not found.

I'm not familiar with either the -cc1 or triple arguments. I don't see them specified on either:

That would explain why we are not processing them. Can you refer me to documentation that describes them? We should be able to fix the issue with -cc1 not being passed through, but I could use more info on the format of the value passed to -triple. Is it the same as --target?

@Colengms
Copy link
Collaborator

Using clang (9, 10, 11, 12), I haven't been able to get it to accept a -triple arg. I get:

clang: error: unknown argument: '-triple'

Is that something unique to Embarcadero C++ ? The form appears to be the same as --target.

@Helmta
Copy link
Author

Helmta commented Jul 30, 2021

Hi @Colengms .

Does your code include uses of MS extensions that fail to compile when -fms-extensions is not specified? If so, I believe we can fix this by falling back to checking the compiler argument if the define is not found.

The code compiles without problems. I think that -fms-extensions is set somewhere implicitly. The fallback would be great.

I'm not familiar with either the -cc1 or triple arguments. I don't see them specified on either:

I have not found any documentation either. The only way is throuh clang -help and compare the output to clang -cc1 -help.
-cc1 has to be the very first argument. So -triple works only with -cc1: clang -cc1 -triple <value> and i think it is the same as --target

https://stackoverflow.com/questions/8991662/what-does-the-clang-cc1-option-do
This explains what -cc1 does.

Thanks for ur great help.
I will be on vacation for 10 days, so i can not answer.

@Colengms
Copy link
Collaborator

The code compiles without problems. I think that -fms-extensions is set somewhere implicitly. The fallback would be great.

Hi @Helmta . I'd like to confirm that the compiler is actually supporting -fms-extensions and not ignoring the arg, before I add support for this scenario. Does your code compile if -fno-ms-extensions is passed instead? If so, it's possible the lack of expected define is due to the feature not actually being enabled.

-cc1 provides access to clang's internal, undocumented args that are passed directly to its compiler layer instead of being processed by the GCC compatibility layer. The C/C++ extension currently supports only the args for the GCC compatibility layer. I've opened the following feature request to add support for internal clang args: #7900

@Colengms Colengms added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 2, 2021
@Colengms Colengms added this to the 1.6.0 milestone Aug 2, 2021
@Colengms Colengms added bug and removed more info needed The issue report is not actionable in its current state labels Aug 2, 2021
@Helmta
Copy link
Author

Helmta commented Aug 10, 2021

Hi @Colengms .
I tested both clang and bcc64 compiler with testcode. I can confirm that clang is working as expected and bcc64 is ignoring the
options -fms-extensions and -fno-ms-extensions.
It compiles successfully, so I think the ms-extensions are enabled by default without setting the define.

Test.cpp:
__declspec(dllexport) void TestFunction(int const test) { auto newTest = test; }

D:\PGA>clang -fno-ms-extensions -c test.cpp
test.cpp:1:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes __declspec(dllexport) void TestFunction(int const test) ^ 1 error generated.

D:\PGA>bcc64 -fno-ms-extensions -c test.cpp
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc. bcc64.exe: warning: argument unused during compilation: '-fno-ms-extensions' [-Wunused-command-line-argument]
test.cpp:

D:\PGA>bcc64 -fms-extensions -c test.cpp
Embarcadero C++ 7.40 for Win64 Copyright (c) 2012-2018 Embarcadero Technologies, Inc. bcc64.exe: warning: argument unused during compilation: '-fms-extensions' [-Wunused-command-line-argument]
test.cpp:

If I use the -cc1 option, I need to activate the ms-extensions.

D:\PGA>bcc64 -cc1 test.cpp
test.cpp:3:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes __declspec(dllexport) void TestFunction(int const test) ^ test.cpp:5:3: warning: 'auto' type specifier is a C++11 extension auto newTest = test; ^ 1 warning and 1 error generated.

D:\PGA>bcc64 -cc1 -fms-extensions test.cpp
test.cpp:5:3: warning: 'auto' type specifier is a C++11 extension auto newTest = test; ^ 1 warning generated.

D:\PGA>bcc64 -cc1 -fno-ms-extensions test.cpp
error: unknown argument: '-fno-ms-extensions'

I tested more code with the original GUI and it is allways invoking the compiler with the -cc1 option.

@Colengms
Copy link
Collaborator

This should be addressed in 1.6.0-insiders.

Note that was addressed by honoring the arg if present on the command line, not by hard-coding awareness of bcc64 (which may be a better solution). Also, because -cc1 is not yet supported (#7900), I'd suggesting passing it without -cc1 (as it should be ignored by the compiler when queried).

@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

2 participants