[cfe-commits] r140931 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/AttributeList.h include/clang/Sema/Sema.h lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaType.cpp test/Parser/MicrosoftExtensions.c

Nico Weber thakis at chromium.org
Thu Oct 6 17:34:54 PDT 2011


On Thu, Oct 6, 2011 at 11:31 AM, John McCall <rjmccall at apple.com> wrote:
> On Oct 6, 2011, at 11:21 AM, Nico Weber wrote:
>> this breaks the build of every project that uses glib and -Werror:
>>
>> In file included from /usr/include/glib-2.0/glib/gasyncqueue.h:34:
>> /usr/include/glib-2.0/glib/gthread.h:348:27: error: 'may_alias'
>> attribute ignored when parsing type
>>  if G_LIKELY ((gpointer) g_atomic_pointer_get (value_location) != NULL)
>>     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /usr/include/glib-2.0/glib/gatomic.h:73:46: note: expanded from:
>>  (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (void
>> *) (atomic)))
>>                                             ^
>> /usr/include/glib-2.0/glib/gmacros.h:111:43: note: expanded from:
>> #  define G_GNUC_MAY_ALIAS __attribute__((may_alias))
>>                                          ^
>> /usr/include/glib-2.0/glib/gmacros.h:273:25: note: expanded from:
>> #define G_LIKELY(expr) (expr)
>>                        ^~~~
>>
>> Thoughts? Should this be a disablable warning?
>
> All warnings should be disablable, but this specific problem should be fixed by making clang recognize may_alias.

Thanks, I opened http://llvm.org/bugs/PR11082 for that. It looks like
type attributes are usually translated into Qualifiers, but according
to test/CodeGen/may-alias.c and
http://gcc.gnu.org/ml/gcc-patches/2008-01/msg01161.html , may_alias
shouldn't really affect a type.




More information about the cfe-commits mailing list