http://llvm.org/bugs/show_bug.cgi?id=11612

             Bug #: 11612
           Summary: _Atomic does not allow initialisation -- needed for
                    ATOMIC_VAR_INIT()
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


The latest C1X draft mentions a macro called ATOMIC_VAR_INIT() that can be used
to initialize an atomic variable.

_Atomic(int) i = ATOMIC_VAR_INIT(3);

As an experiment, I implemented a C-centric version of <stdatomic.h> for
FreeBSD:

http://80386.nl/pub/stdatomic.txt

Now the question is: how should I implement ATOMIC_VAR_INIT()? It seems like
assigning values to these variables directly doesn't work:

error: initializing '_Atomic(int)' with an expression of incompatible type
'int';
_Atomic(int) x = 3;
             ^   ~

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to