|
|
Log in / Subscribe / Register

> Miguel Ojeda

> Miguel Ojeda

Posted Aug 2, 2019 2:16 UTC (Fri) by scientes (guest, #83068)
Parent article: An end to implicit fall-throughs in the kernel

Numerous people (including me) posted patches avoiding these magic comments. I am the maintainer of distcc, and use of magic comments makes distcc (which compiles the prepossessed files that lack comments) very noisy.


to post comments

distcc

Posted Aug 2, 2019 10:30 UTC (Fri) by jani (subscriber, #74547) [Link] (3 responses)

> use of magic comments makes distcc (which compiles the prepossessed files that lack comments) very noisy.

Care to elaborate?

distcc

Posted Aug 2, 2019 10:38 UTC (Fri) by mageta (subscriber, #89696) [Link] (2 responses)

I imagine it stems from the fact that distcc sends already pre-processed files to the "compute"-nodes (it does this so the compute-nodes don't need any of the include files and such, so they just need to do the compile-step, which should be free of any "side-effects"). As such they have all comments stripped from them, but the compiler flags are still passed to the compiler running on the compute-node, and because they don't see the comments, they will complain about the missing comments.

Similar things can happen with other certain diagnostics that rely on seeing un-expanded macros (e.g.: -Wtautological-compare). They will complain, because Macros are already expanded in the files sent to the compute-node.

distcc

Posted Aug 2, 2019 12:55 UTC (Fri) by mageta (subscriber, #89696) [Link] (1 responses)

Oh, I forgot, one can suppress the major grunt of these warnings by passing additional CFLAGs into the KBuild system.

When building with distcc, I have been passing 'KCFLAGS=-Wno-tautological-compare' for a while now. This suppresses 95% of the complaints, but not every compiler-call honors KCFLAGS.. and I have been too lazy to track down why that is, its probably a bug.

I imagine one can work around the new warnings from the fall-through diagnostics in a similar way! Have not tested it yet though.

distcc

Posted Aug 2, 2019 18:20 UTC (Fri) by scientes (guest, #83068) [Link]

This is great to know. I will consider adding this by default.

> Miguel Ojeda

Posted Aug 2, 2019 13:44 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

Is `-fdirectives-only` not sufficient? That would end up handling `#include`, and `#if`-like directives (`#define` is handled, but left in the output), leaving macro use in the code itself as-is. I guess the comments still end up being stripped though…but this could help the tautological-compare warnings at least.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds