pci_alloc_msi is always called, is this bad?

Scott Long scott4long at yahoo.com
Fri Oct 4 16:41:25 UTC 2013


On Oct 4, 2013, at 10:19 AM, Konstantin Belousov <kostikbel at gmail.com> wrote:

> On Fri, Oct 04, 2013 at 10:05:18AM -0600, Scott Long wrote:
>> It used to be that gcc would generate code that would conditionally execute the second clause only if the first clause were true.  If that's not longer the case (with gcc and/or clang), then I bet that UDF will break due to this:
>> 
>>       /*
>>         * Check to see if the fid is fragmented. The first test
>>         * ensures that we don't wander off the end of the buffer
>>         * looking for the l_iu and l_fi fields.
>>         */
>>        if (ds->off + UDF_FID_SIZE > ds->size ||
>>            ds->off + le16toh(fid->l_iu) + fid->l_fi + UDF_FID_SIZE > ds->size){
> Is this some sort of joke ?
> 
> C 'and' and 'or' logical operators are short-circuit. It is not
> compiler-depended.

Meh, I was young and stupid.  The generated code supported the construct.

Scott



More information about the freebsd-scsi mailing list