Richard Guenther wrote:
>
>
> So the following steps need to be done before releasing 1.0:
> - remove all assert()s from exported API functions, instead
Nope.
> replace them with usual checks and return appropriate errors
> instead (and document this). F.i.
> const char *snd_pcm_name(snd_pcm_t *pcm)
> {
> assert(pcm);
> return pcm->name;
> }
> should become
> const char *snd_pcm_name(snd_pcm_t *pcm)
> {
> if (!pcm)
> return NULL;
> return pcm->name;
> }
None of the asserts should be generated on a bogus input from user and
if this is not true this *IS* a bug and need to be fixed.
The case you're indicating is not a bug as the user has no way (except a
very bogus program) to generate a failed assert.
So the rule is:
- dynamic checks for bogus input from user
- asserts (that can be disabled in production releases for efficiency
reasons) for program bugs (although outside of alsa-lib).
--
Abramo Bagnara mailto:[EMAIL PROTECTED]
Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy
ALSA project http://www.alsa-project.org
It sounds good!
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel