[llvm-commits] Patch for strict alias warning in Support/Allocator.cpp

me22 me22.ca at gmail.com
Wed Feb 21 22:41:24 PST 2007


I only saw 3 warnings compiling llvm, 2 of which looked like flex's
fault, so it made me want to fix the other one:
Allocator.cpp: In member function 'void*
llvm::BumpPtrAllocator::Allocate(unsigned int, unsigned int)':
Allocator.cpp:96: warning: dereferencing type-punned pointer will
break strict-aliasing rules

I'm not convinced it actually broke aliasing rules, but it's a fairly
trivial fix that simplifies the code, so it seems worth it.  Only
possible drawback is that it (opaquely) exposes MemRegion, but that
identifier is used nowhere else in llvm at the moment.

HTH,
Scott McMurray
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_aliasing_warning_in_Allocator.patch
Type: text/x-patch
Size: 2973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070222/13f47ee9/attachment.bin>


More information about the llvm-commits mailing list