[LTP] [PATCH 1/2] ptrace07: Fix compilation when not on x86
Li Wang
liwang@redhat.com
Thu Oct 20 05:53:43 CEST 2022
On Wed, Oct 19, 2022 at 5:30 PM Martin Doucha <mdoucha@suse.cz> wrote:
> On 18. 10. 22 17:25, Richard Palethorpe via ltp wrote:
> > Strictly cpuid.h should not be included on non-x86, but this means
> > each test author has to remember not to include it. Instead we can set
> > a blank macro to allow compilation.
> >
> > Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> > ---
>
> Hi,
> defining an empty macro is a bad idea because it'll allow a broken test
> to be compiled and then it'll behave erratically for no apparent reason.
> It's better to get a build failure.
>
> Reverting 1df4de06206b079f24dde7157d037b48727c743d is the best solution
> here. Building ptrace07 and similar arch-specific tests without a key
> piece of code does not make sense. The preprocessor arch checks should
> wrap around the whole file, not just a small non-portable bit that's
> crucial for the test to work.
>
>From what I know, one of the uses of "empty macro" is to conditionally
include certain portions of a program. In ptrace07, it invokes that useless
macro for compiling pass on non-x86 arch but does not allow execute it.
I don't see why that's crucial for a test, if we wrap around the whole file
and
avoid it compiling on non-x86, isn't this essentially same as that?
The only distinction between them is partly or wholly skipping the key
code compilation. or maybe I completely misunderstood this part.
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20221020/2349e207/attachment.htm>
More information about the ltp
mailing list