Am Sonntag, 18. Dezember 2022, 05:40:38 CET schrieb Gerhard Sittig:
> On Sun, 2022-12-18 at 02:29 +0100, Markus Heidelberg wrote:
> >
> > Am Samstag, 17. Dezember 2022, 20:26:42 CET schrieb Gerhard Sittig:
> > > On Fri, 2022-12-16 at 19:37 +0100, Gerhard Sittig wrote:
> > > >
> > > > On Sun, 2022-12-11 at 02:30 +0100, Markus Heidelberg wrote:
> > > > >
> > > > > I found some crashes using PulseView with specific command line 
> > > > > options.
> > > > >
> > > > > https://github.com/sigrokproject/libsigrok/pull/202
> > > >
> > > > Am in the process of taking the part that I'm confident about,
> > > > the trace32 input. Samplerates should be u64 everywhere, no
> > > > questions asked.
> > > >
> > > > Am more reluctant on the bindings, since I don't know and don't
> > > > use most of them. Would be good to have more eyes on this part of
> > > > your submission.
> > >
> > > Can you check
> > > https://repo.or.cz/libsigrok/gsi.git/shortlog/refs/heads/binding-u32
> > > and ACK or NAK the squash that I would apply to take it mainline?
> > > As usual, alternatively provide something different which I
> > > should then take instead.
> >
> > Oh, using "stoui" wasn't a typo, but intention. I should have made this
> > clearer with a comment at least.
> >
> > The block in question is actually a replacement for stoui(), which is
> > missing in the C++ standard:
> >
> >     unsigned long tmp = stoul(value);
> >     if (tmp > std::numeric_limits<uint32_t>::max()) {
> >             throw std::out_of_range("stoui");
> >     }
>
> Have pushed 2e379708554e to my binding-u32 branch. That hopefully
> better fits what's currently in mainline.

A separate helper function is obviously the right solution here.
ACK

> Your u32 path is the
> first to actually check for the specific _u32_ value range.
> Others check for something more generic like "int" instead, and
> then propagate values through types.

These generic "int" types reliably cause system dependent problems so I
think it's best to avoid them in areas where specific sizes are used
anyway.

> Have changed stoui to stou32 because that specific u32 range is
> checked for.

ACK





_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to