Re: VLA detection ...

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

 



On Mon, 5 Jun 2017, Willem Jan Withagen wrote:

Hi Willem,

Thank you for your comments!

I think your remarks are all valid and referencing VLA could/should be
done with some careful gards. On the otherhand the code is full with
pointer, and not all constructs are 100% C++ type, and can also run out
of bound. (As I've already noticed a few times)

We certainly need to be able to use "dangerous" constructs, and to be sure they're present for good reasons.

In my view, the problem isn't that VLAs exist, it's that're so easy to use by complete accident, and if ever mis-used can lead to some extremely subtle problems that in a bad case are difficult to reproduce and even harder to find.

So care has to be taken when VLA are used, as with all constructs one
selects to solve a problem.

Definitely agreed.

The disadvantage with just switching on warnings is that they start to
bloat. And as such start to create noise, masquerading/distracting from
new real important warning. Because that is what is going to happen:
People start just reading over them, and then some more.

I'm happy to provide patches, and resubmit the PR at some point soon. Completely agreed that warnings have to be useful, and if we ignore them then they might as well not be there.

I, for one, disagree with that. It is not going to help the problem by
switching the warnings on. The actual issue needs to be fixed, Kefu
tried that, and declared his first attempt not really satisfactory.

I'll try to catch up with Kefu and see where the pain points were.

So I think this is going to stay here until "the stds group", in its
infinite wisdom has designed a solution for this that actually works.
Until then, all bets are of.

I know that there are some relevant proposals, but AFAIK not super strong traction just yet.

As long as nothing's actually exploded, I suppose it's like pointing at a bunch of TNT and saying "hey, we probably shouldn't smoke near that", but nobody's happend to do it yet so it seems fine. ;-)

Not to sound pedantic, but this is all part of this of code requirements
that are sort underlying this project. But I have yet to see that people
are being hit over the head with these rules. (Unlike in other projects
where I work and we had regular audits to check confirmity to the code
rules)

It's unclear to me what extensions we do and do not allow. If the project is in standard C++11, VLAs shouldn't be allowed because they're not part of the language. Then again, that sort of pedanticism may be of limited actual utility.

Or be like me, I try to keep things FreeBSD compatible, and try to chase
people using VLAs suggesting that they pick a different solution.

I'll try to see where we're using them now and get a sense of where they are specifically chosen and useful.

Lets get back to programming.....

Always a good plan! :-)

-Jesse
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux