Skip to content
Snippets Groups Projects

use -fno-strict-aliasing for code using COM pointers

Merged Steve Lhomme requested to merge robUx4/vlc:com-ptr-aliasing into master

Following the discussion in !869 (merged) it might not be safe to cast to void** to get pointer values and thus using IID_PPV_ARGS or WRL. Using -fno-strict-aliasing should allow us to use this helpful Windows/compiler API's.

This might be backported to 3.0 where COM and WRL are used.

v2:

  • C++ modules only
  • renamed to LIBCOMFLAGS

v3:

  • added freetype/dwrite which uses WRL and COM without LIBCOM (DWriteCreateFactory)
  • split the general commit using LIBCOMFLAGS so they can be backported to 3.0 independently

v4:

  • test -fno-strict-aliasing with the C++ compiler, not the C compiler

v5:

  • fix missing AM_CXXFLAGS for dwrite

v8:

  • have -fno-strict-aliasing on Windows or fail configure :boom:
  • renamed the flag to LIBCOMCXXFLAGS to show it should be used in C++ code, the fancy C++ helpers are not available there, the code will have to be clean from pointer aliasing with COM objects.
Edited by Steve Lhomme

Merge request reports

Merge request pipeline #201133 passed

Merge request pipeline passed for acad6ed0

Merged by Hugo Beauzée-LuyssenHugo Beauzée-Luyssen 2 years ago (Mar 17, 2022 2:48pm UTC)

Loading

Pipeline #201321 passed

Pipeline passed for acad6ed0 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading