Re: [PATCH v2] for_each_string_list_item: avoid undefined behavior for empty list

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

 



On Wednesday 20 September 2017 10:57 AM, Jonathan Nieder wrote:
Guard the loop with a NULL check to make the intent crystal clear to
even the most pedantic compiler.  A suitably clever compiler could let
the NULL check only run in the first iteration,

Noted this just now. So, the overhead doesn't occur when the compilers
are clever enough. And as I said in my previous email to this thread, at
least 'gcc' and 'clang' seem to be clever enough.
... but regardless, this
overhead is likely to be dwarfed by the work to be done on each item.

:-) That's of course seems to be true.




[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