04:26:20 what exactly cstyle isn't happy about here: https://pastebin.com/HC8Sr30G? "t.h: 1: missing space before left brace" 04:27:39 adding whitespace before brace makes it say "whitespace after left paren" 05:10:31 yuripv: I think you want a do {} while (0) guard there? 05:13:15 yuripv: like https://github.com/illumos/illumos-gate/blob/17c4dadf772c2bfb28130f501dc6e1f46f8b1250/usr/src/uts/common/fs/zfs/sys/arc_impl.h#L346-L352 05:13:32 without the _NOTE(CONSTCOND) obviously because we don't note.h anymore 05:21:28 the macro is used then as "val = MACRO(arg);" and that fails with "expected expression before 'do'" 05:21:44 not my code, and it builds and works fine as it is, it's just cstyle that isn't happy 05:23:32 macros that return things feel somewhat unsavoury 05:23:39 unless they're just expressions 05:24:32 inline function perhaps? 05:27:03 If it has to be a macro I don't know what the parens around the braces buy you 05:27:10 so I would try removing them? 05:28:06 expected expression before '{' token 05:28:26 can you maybe show me more of the code 05:28:28 so inline functions could be an answer here 05:28:54 I think inline functions are probably in general better than macros for a variety of reasons though yeah 05:29:17 (more contained, more type safe, less accidental double-evaluation of arguments, etc) 05:29:33 https://pastebin.com/9cVycc6S 05:29:39 as an example 05:29:44 ah 05:31:03 We're definitely into a corner of C I am not comfortable in haha 05:31:12 that really doesn't seem like it could possibly be an expression 05:32:16 also.. __typeof yeesh 05:32:20 and __typeof for type of return value would not allow for inline function? 05:32:27 I guess yeah 05:32:44 I suppose you can always /*CSTYLED*/ it! 05:33:46 also, this must surely be in whacky third party code? 05:34:11 It wouldn't be the first third party code to end up on https://github.com/illumos/illumos-gate/blob/master/exception_lists/cstyle 05:34:22 if we're planning to update it in future without restyling it for example 05:35:02 is it from some SNMP thing? 05:35:06 yes, 3d party code that i'm just trying to build and look a bit better 05:35:08 yep 05:35:48 experimenting with begemot snmp implementation instead of unwieldy net-snmp 05:35:52 if it's 3rd party it would not be the end of the world for it to be cstyle exempt on some level, I suspect. Probably someone else should weigh in to tell me I'm not crazy 05:37:15 thanks Joshua 05:37:26 you're welcome! 05:37:32 hope the experiment goes w{ll 05:37:34 *well 12:21:57 tsoome ping 20:35:08 I think gcc finds that to be an expression 20:35:14 I'm not sure if that's an extension 20:35:57 isn't that the same kind of weird trick we pull for strdupa (in spirit, if not in fact?) 20:36:31 yeah, we wrap it in __extension__() and damn the indentation 20:36:34 see string.h 20:37:02 I'd prefer /*CSTYLED*/ to just ignoring taste 20:37:38 it's meant to make your code "fit in", not to make your code fucking ugly because a perl script says so 20:37:47 if that helps guide you :) 20:42:02 yes, ({...}) are gcc "statement expressions", which I doubt cstyle ever knew about: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html 20:45:28 they're proposed for a version of the C standard after C23, but for now I think are just a gcc extension that some other compilers (including Studio 12.6 I believe) now also support