Skip to contentSkip to conversation

test case against union aliasing

DISCUSSION Andy Shevchenko 2 participants 2 messages Feb 27, 2018

lore
Share & tools
lore
#0 lore raw

Hi!

It seems we have some code in kernel which utilizes (rightlessly for now) union aliasing.

So, can we create a test case against such? (Three steps: a) replace union by struct keyword in data type in question, b) compile, c) run in Qemu with proper functional test)

Does it make any sense?

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#1 lore raw
Quoted 10 lines · Andy Shevchenko

Hi!

It seems we have some code in kernel which utilizes (rightlessly for now) union aliasing.

So, can we create a test case against such? (Three steps: a) replace union by struct keyword in data type in question, b) compile, c) run in Qemu with proper functional test)

Does it make any sense?

I think so. If you want to do it more safely than with sed, it should be possible with Coccinelle, with just

@@
identifier i;
@@

-union i
+struct i

julia