Bug 1222786 - Clang fails to compile files including stdatomic.h, due to being configured to look at GCC's headers.
Summary: Clang fails to compile files including stdatomic.h, due to being configured t...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-19 07:40 UTC by John Steele Scott
Modified: 2015-12-02 18:02 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-02 12:31:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description John Steele Scott 2015-05-19 07:40:48 UTC
Description of problem:

Clang fails to compile C11 code which includes stdatomic.h. According to <https://llvm.org/bugs/show_bug.cgi?id=22740#c5>, Clang should not be looking at GCC's headers. Fedora tells Clang to look there via the --with-c-include-dirs configuration flag. Bug 893817 suggests that this flag has historically been necessary in order to successfully use libstdc++, but this no longer seems to be the case (see <https://llvm.org/bugs/show_bug.cgi?id=6907>).


Version-Release number of selected component (if applicable):

clang-3.5.0-6.fc21.x86_64

How reproducible:

Every time.

Steps to Reproduce:

Compile the following example program:

$ cat atomic.c
#include <stdatomic.h>

int f (atomic_int *p_i)
{
  return atomic_load(p_i);
}


Actual results:

$ clang -std=c11 -c atomic.c
atomic.c:5:27: error: use of undeclared identifier '__auto_type'
  return __extension__ ({ __auto_type __atomic_load_ptr = (p_i); __typeof__ (*__atomic_load_ptr) __atomic_load_tmp; __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (5)); __atomic_load_tmp; });
                          ^
atomic.c:5:79: error: use of undeclared identifier '__atomic_load_ptr'
  return __extension__ ({ __auto_type __atomic_load_ptr = (p_i); __typeof__ (*__atomic_load_ptr) __atomic_load_tmp; __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (5)); __atomic_load_tmp; });
                                                                              ^
atomic.c:5:132: error: use of undeclared identifier '__atomic_load_ptr'; did you mean '__atomic_load_tmp'?
  return __extension__ ({ __auto_type __atomic_load_ptr = (p_i); __typeof__ (*__atomic_load_ptr) __atomic_load_tmp; __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (5)); __atomic_load_tmp; });
                                                                                                                                   ^~~~~~~~~~~~~~~~~
                                                                                                                                   __atomic_load_tmp
atomic.c:5:98: note: '__atomic_load_tmp' declared here
  return __extension__ ({ __auto_type __atomic_load_ptr = (p_i); __typeof__ (*__atomic_load_ptr) __atomic_load_tmp; __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (5)); __atomic_load_tmp; });
                                                                                                 ^
atomic.c:5:10: error: returning 'void' from a function with incompatible result type 'int'
  return __extension__ ({ __auto_type __atomic_load_ptr = (p_i); __typeof__ (*__atomic_load_ptr) __atomic_load_tmp; __atomic_load (__atomic_load_ptr, &__atomic_load_tmp, (5)); __atomic_load_tmp; });
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.

Expected results:

Should compile with no errors. This code compiles fine with GCC, and compiles fine if clang is not passed the --with-c-include-dirs configuration flag.

Additional info:

https://llvm.org/bugs/show_bug.cgi?id=22740
https://llvm.org/bugs/show_bug.cgi?id=23556

Comment 1 Fedora End Of Life 2015-11-04 11:55:07 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2015-12-02 12:32:08 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.