Re: [PATCH 0/2] Fix syntax errors under clang 11.0.0 on MacOS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 10/6/22 3:43 PM, Jeff Hostetler via GitGitGadget wrote:
This patch series fixes three syntax errors that caused compiler errors with
clang 11.0.0 on MacOS. I've included the error/warning messages in the
commit messages. The offending statements did compile successfully under
clang 14.0.0 on MacOS, so I have to assume that this usage is newer than
what clang 11 supports.
[...]

I didn't realize that these variable initialization fixes would
spawn such a large response here [1].  Nor that it had been already
discussed in great length in [2] in July.

I'm not sure how to best proceed here.

* I'm not sure these fixes are important enough to warrant the
  engineering time to hack up the Makefile or config.mak.uname
  to conditionally turn off -Wno-missing-braces based on some
  {platform-os-version, gcc/clang-version} combination.

* While -Wno-missing-braces option may prevent the warning/error
  (depending on -Werror) for these "{0}" should be "{{0}}"
  errors, do we know that this won't hide real problems.  (I mean
  we tend to only see it for these {0} / {{0}} false alarms, but
  I'd hate to lose the protection for non-false alarms.)

* The suggestion to use a <type>_INIT macro to hide the {0} or
  {{0}} may help in the:
        xmparam_t xmp = XMPARAM_INIT;
  case, but in the `mmfile_t mmfs[3]` case, we have an array of
  that type, so we'd need something like:
     mmfile_t mmfs[3] = { MMFILE_INIT }; or
     mmfile_t mmfs[3] = MMFILE_INIT_ARRAY;
  for the macros to make sense.
  I'm not sure either of these two is better than just writing "{{0}}".

* I wasn't sure which compiler versions we *want* to support or
  want to drop support for.
  * I've only thought about it in the context of clang on MacOS.
  * Clang 11 (from what I can tell (without looking too hard))
    comes with the version of XCode that runs on MacOS 10.15
    Catalina.  (In contrast, clang 14 comes with the version of
    XCode that runs on MacOS 12.6 Monterey.)
  * I can't comment on other old-ish compilers on other platforms.

* I'm not the first one who has stumbled over this and had to
  rediscover the solution.  So I'd hate to just kick this down
  the road some more, but then again I'd hate to waste a lot of
  time on it -- for very little actual functional value.

* Is "{{0}}" really that ugly ???

So as I said earlier, I'm not sure how to proceed here.

Jeff


[1] https://lore.kernel.org/git/pull.1375.git.1665085395.gitgitgadget@xxxxxxxxx/

[2] https://lore.kernel.org/git/365e01e93dce582e9d926e83bdc6891310d22699.1659084832.git.congdanhqx@xxxxxxxxx/



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux