#716: [PATCH] Remove incorrect check for function pointer alignment
-----------------------+----------------------------------------------------
Reporter: doughera | Owner:
Type: patch | Status: new
Priority: minor | Milestone:
Component: configure | Version: 1.2.0
Severity: low | Keywords:
Lang: | Patch: new
Platform: |
-----------------------+----------------------------------------------------
Configure.pl currently sets HAS_aligned_funcptr if the user is using gcc
(but not on HPUX). The only place it is used is src/multidispatch.c,
which checks if the func_ptr & 3 == 0.
This is wrong on several fronts. First, other
compilers/architectures/operating systems can certainly use aligned
function pointers. Second, the number '3' is, in general, wrong. Gcc's
-faligned-functions[=n] option can take a variety of 'n' values (and can
implicitly be set to different values by other options, such as -O[n].)
The Configure.pl setting ignores all that.
If we really cared about the exact number, we should write a Configure
test to actually measure the alignment using the full set of compiler
flags that will be used to build parrot. The ASSERT in
src/multidispatch.c would then be altered to use the measured alignment
number.
Failing that, however, it makes sense to just delete the inaccurate ASSERT
and the corresponding Configure.pl stuff. The attached patch does just
that.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/716>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets