[Cake] [PATCH] net/sch_generic.h: use sizeof_member() and get rid of unused variable

David Miller davem at davemloft.net
Wed May 20 14:17:17 EDT 2020


From: Antonio Quartulli <a at unstable.cc>
Date: Wed, 20 May 2020 10:39:33 +0200

> I don't think it's BUILD_BUG_ON()'s fault, because qcb->data is passed
> to sizeof() first.
> 
> My best guess is that gcc is somewhat optimizing the sizeof(gcb->data)
> and thus leaving the gcb variable unused.

If you remove the argument from the function but leave the BUILD_BUG_ON()
calls the same, the compilation will fail.

Any such optimization is therefore unreasonable.

The variable is used otherwise compilation would not fail when you
remove it right?


More information about the Cake mailing list