Hi! on 2022/7/22 09:02, Segher Boessenkool wrote: > Hi! > > On Fri, Jul 22, 2022 at 08:41:43AM +0800, Kewen.Lin wrote: >> Hi Segher, >> >> Thanks for the comments! > > Always. > >>>> This patch is to fix empty TUs with one dummy variable definition >>>> accordingly. >>> >>> You can also use >>> enum{a}; >>> which is shorter, but more importantly does not generate any code. >>> You can also do >>> extern int dummy; >>> of course -- same idea, no definitions, only declarations. >> >> The used "int dummy" follows some existing practices, IMHO in this >> context it doesn't matter that it will generate code or not, any of >> these alternatives still generates an assembly or object file, but >> the generated file gets removed after the checking. > > It doesn't matter here, sure. But it is certainly simple enough to make > it "extern int dummy" instead, not giving a bad example for future cases > where it may matter :-) >
OK. >> May I still keep this "int dummy" to align with existing practices? > > Of course, it was just advice. If things are wrong (in my opinion that > is!), I'll say so. > Got it, thanks! :) >>> At least put it in #else then? Or just do things a bit more elegantly >>> (do a dummy function around this for example). >> >> OK, since it can still emit error even without "#else", I didn't bother >> to add it. I will add it, and update the "nope no good" to "#error >> doesn't have float128 support". > > Just say > > === > void nope (void) > { > #ifndef __FLOAT128__ > nope no good > #endif > } > === > > which works in all cases? Yeah, good idea, I'll make a new version of patch based on this. Thanks again! BR, Kewen > > Less maintenance is a good thing :-) > > > Segher