<html><head></head><body>alloca() is worse than VLAs in every possible ways. It's non-standard, it has function scope instead of block scope, and it does not support sizeof().<br><br>There's already -Wvla if you want to track VLAs.<br><br><div class="gmail_quote">Le 1 octobre 2020 10:14:19 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2020-10-01 9:00, Alexandre Janniaux wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Hi,<br><br>On Thu, Oct 01, 2020 at 07:43:10AM +0200, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">It's correct but I think a cleaner way would be to just allocate the tables<br>in the stack like<br>DXVAHD_VPCAPS capsList[devcaps.VideoProcessorCount];<br></blockquote>I'm not sure we want to reintroduce new VLA in the code<br>though. That's not for nothing that it has been relegated<br>into an optional features in C11 and that IIRC compilers<br>like compcert don't want to implement them.<br></blockquote><br>Personally I would use alloca() everywhere so we can try possible stack <br>overflow sources, but I don't think this policy was agreed on, let alone <br>the use of alloca().<br><br>>><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> MSVC doesn't like these initializations, but I that ship has sailed a long<br> time ago anyway.<br><br> On 2020-09-17 21:18, Lyndon Brown wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"> the memory allocations here are released in the error path, but not the<br> success path, which looks to be a mistake to me...<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>