Skip to contentSkip to conversation

Function-like macro with the same name as a typedef

Cocci Markus Elfring 2 participants 6 messages Apr 6, 2020 – Apr 20, 2020

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines

* spatch seems to have trouble parsing

    ARMSSE *s = ARMSSE(opaque);

where ARMSSE is a typedef, and ARMSSE() is a function-like macro. Yes, I know that's in rather poor taste.

I am curious for the safe handling of related software development challenges.

Quoted 1 line

* Workaround #1: rename the typedef to ARMSSE_

Will adjustments become more interesting also around such name space issues?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#1 lore raw
Quoted 7 lines · Markus Elfring
Quoted 6 lines

* spatch seems to have trouble parsing

    ARMSSE *s = ARMSSE(opaque);

where ARMSSE is a typedef, and ARMSSE() is a function-like macro. Yes, I know that's in rather poor taste.

Quoted 6 lines

I am curious for the safe handling of related software development challenges.

Quoted 1 line

* Workaround #1: rename the typedef to ARMSSE_

Will adjustments become more interesting also around such name space issues?

I'm not sure I understand your question. Can you elaborate?

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#2 lore raw
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

* spatch seems to have trouble parsing

    ARMSSE *s = ARMSSE(opaque);

where ARMSSE is a typedef, and ARMSSE() is a function-like macro. Yes, I know that's in rather poor taste.

Quoted 8 lines
Quoted 6 lines

I am curious for the safe handling of related software development challenges.

Quoted 1 line

* Workaround #1: rename the typedef to ARMSSE_

Will adjustments become more interesting also around such name space issues?

I'm not sure I understand your question. Can you elaborate?

Do we come along the need to adjust (or even improve) two software areas?

* How many software implementations use identical type definitions and function-like macros?

* How will the evolution be continued around Coccinelle?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#3 lore raw
Quoted 12 lines · Markus Elfring
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

* spatch seems to have trouble parsing

    ARMSSE *s = ARMSSE(opaque);

where ARMSSE is a typedef, and ARMSSE() is a function-like macro. Yes, I know that's in rather poor taste.

I am curious for the safe handling of related software development challenges.

Quoted 1 line

* Workaround #1: rename the typedef to ARMSSE_

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Will adjustments become more interesting also around such name space issues?

I'm not sure I understand your question. Can you elaborate?

Do we come along the need to adjust (or even improve) two software areas?

* How many software implementations use identical type definitions and function-like macros?

I don't know. For what it's worth, it's valid C. Unless I'm mistaken, Coccinelle tries to support as much of C as it possibly can.

The QEMU project can certainly work around this Coccinelle bug / restriction.

I'm reporting it because I've found Coccinelle useful.

Quoted 1 line

* How will the evolution be continued around Coccinelle?

Is this a question about Coccinelle's future?

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#4 lore raw
Quoted 4 lines
Quoted 2 lines

* How many software implementations use identical type definitions and function-like macros?

I don't know.

Can it become interesting to find more about such usage patterns out?

Quoted 2 lines

For what it's worth, it's valid C. Unless I'm mistaken, Coccinelle tries to support as much of C as it possibly can.

How do you think about limitations for corresponding software development resources?

Quoted 2 lines

The QEMU project can certainly work around this Coccinelle bug / restriction.

Which adjustments will be chosen?

Quoted 3 lines
Quoted 1 line

* How will the evolution be continued around Coccinelle?

Is this a question about Coccinelle's future?

Yes, of course.

Are we trying to influence further development anyhow?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#5 lore raw
Quoted 6 lines · Markus Elfring
Quoted 4 lines
Quoted 2 lines

* How many software implementations use identical type definitions and function-like macros?

I don't know.

Can it become interesting to find more about such usage patterns out?

Rule of thumb: for every user reporting an issue, there are several more suffering quietly. How many more? I don't know.

A better estimate of how widespread such use is might be useful, but I can't provide one.

Quoted 11 lines
Quoted 2 lines

For what it's worth, it's valid C. Unless I'm mistaken, Coccinelle tries to support as much of C as it possibly can.

How do you think about limitations for corresponding software development resources?

Quoted 2 lines

The QEMU project can certainly work around this Coccinelle bug / restriction.

Which adjustments will be chosen?

Rename either the typedef or the macro. More complicated than it sounds, because both conform to naming conventions.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

* How will the evolution be continued around Coccinelle?

Is this a question about Coccinelle's future?

Yes, of course.

Are we trying to influence further development anyhow?

I'm trying to help the Coccinelle project by reporting an issue, no more, no less :)

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci