pvr: Force compile error on GNU void pointer arithmetic
This GNU extension caused a bug where a void pointer was modified then interpreted as uint32_t* (instead of the other way round). Force a compile error to (hopefully) prevent this from happening again. Signed-off-by: Matt Coster <matt.coster@imgtec.com> Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25327>
This commit is contained in:
@@ -34,6 +34,6 @@ libpowervr_common = static_library(
|
||||
inc_src,
|
||||
inc_imagination,
|
||||
],
|
||||
c_args : [no_override_init_args],
|
||||
c_args : [imagination_c_args, no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
imagination_c_args = cc.get_supported_arguments(
|
||||
'-Werror=pointer-arith',
|
||||
)
|
||||
|
||||
inc_imagination = include_directories([
|
||||
'.',
|
||||
'common',
|
||||
|
||||
@@ -63,7 +63,7 @@ libpowervr_rogue = shared_library(
|
||||
inc_include,
|
||||
inc_src,
|
||||
],
|
||||
c_args : [no_override_init_args],
|
||||
c_args : [imagination_c_args, no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
dependencies : [idep_mesautil, idep_nir, idep_vulkan_runtime, dep_csbgen],
|
||||
install : true,
|
||||
|
||||
@@ -32,6 +32,7 @@ rogue_compiler = executable(
|
||||
inc_src,
|
||||
inc_rogue,
|
||||
],
|
||||
c_args : [imagination_c_args],
|
||||
build_by_default : with_imagination_tools,
|
||||
install : false,
|
||||
)
|
||||
|
||||
@@ -91,6 +91,7 @@ pvr_deps = [
|
||||
]
|
||||
|
||||
pvr_flags = [
|
||||
imagination_c_args,
|
||||
no_override_init_args,
|
||||
]
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ libpowervr_pds = static_library(
|
||||
inc_imagination,
|
||||
],
|
||||
c_args : [
|
||||
imagination_c_args,
|
||||
no_override_init_args,
|
||||
],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
|
||||
Reference in New Issue
Block a user