Skip to content

clang breaks strict-aliasing rules according to g++4.4 #4433

@edwintorok

Description

@edwintorok
Bugzilla Link 4061
Resolution WONTFIX
Resolved on Jun 13, 2012 13:24
Version unspecified
OS Linux
CC @akyrtzi,@lattner,@DougGregor,@tlattner

Extended Description

/home/edwin/llvm-svn/llvm/include/llvm/ADT/APInt.h: In member function ‘bool clang::Expr::isIntegerConstantExpr(llvm::APSInt&, clang::ASTContext&, clang::SourceLocation*, bool) const’:
/home/edwin/llvm-svn/llvm/include/llvm/ADT/APInt.h:99: warning: dereferencing pointer ‘’ does break strict-aliasing rules
/home/edwin/llvm-svn/llvm/include/llvm/ADT/APInt.h:548: warning: dereferencing pointer ‘’ does break strict-aliasing rules
/home/edwin/llvm-svn/llvm/include/llvm/ADT/APInt.h:549: warning: dereferencing pointer ‘’ does break strict-aliasing rules
/home/edwin/llvm-svn/llvm/include/llvm/ADT/APSInt.h:38: warning: dereferencing pointer ‘’ does break strict-aliasing rules
Expr.cpp:1334: note: initialized from here

The location info for the warning is not accurate (it doesn't show the very line causing the violation), but the aliasing violation is real:
return (APSInt)(void*)Data;

See URL for a possible solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"wontfixIssue is real, but we can't or won't fix it. Not invalid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions