Bug 23725 – ImportC fails to parse __asm __volatile on FreeBSD stdatomic.h and fenv.h

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
FreeBSD
Creation time
2023-02-18T00:19:06Z
Last change time
2023-05-31T08:28:18Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2023-02-18T00:19:06Z
It's the volatile following the asm that is not accepted.
Comment #1 by bugzilla — 2023-02-18T03:55:36Z
The trouble is __GNUCLIKE_ASM is always defined because __GNUC__ is defined. Turning off __GNUC__ causes a lot of error messages like the system .h files need to be edited. __GNUCLIKE_ASM turns on use of the inline assembler.
Comment #2 by bugzilla — 2023-03-19T05:23:48Z
The troublesome block of code in ieeefp.h looks like: #define __fldcw(addr) __asm __volatile("fldcw %0" : : "m" (*(addr))) #define __fldenv(addr) __asm __volatile("fldenv %0" : : "m" (*(addr))) #define __fnclex() __asm __volatile("fnclex") #define __fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr))) #define __fnstenv(addr) __asm __volatile("fnstenv %0" : "=m" (*(addr))) #define __fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr))) #define __ldmxcsr(addr) __asm __volatile("ldmxcsr %0" : : "m" (*(addr))) #define __stmxcsr(addr) __asm __volatile("stmxcsr %0" : "=m" (*(addr)))
Comment #3 by dlang-bot — 2023-03-19T05:37:24Z
@WalterBright created dlang/dmd pull request #15004 "fix Issue 23725 - ImportC fails to parse __asm __volatile on FreeBSD …" fixing this issue: - fix Issue 23725 - ImportC fails to parse __asm __volatile on FreeBSD stdatomic.h and fenv.h https://github.com/dlang/dmd/pull/15004
Comment #4 by bugzilla — 2023-03-25T01:42:06Z