asserts active by default

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

 



rdiezmail-pulseaudio at yahoo.de wrote:
> [2nd try, the first message went apparently lost]
> 
> Hi all:
> 
> I have noticed that the assert() calls inside the libpulse client
> library are enabled by default. I would expect asserts to be disabled
> in release builds, via the NDEBUG macro or similar compile-time
> switch.
> 
> What's the common practice for asserts in the OSS world in this kind
> of libraries?
> 
> I've seen in other projects a "--disable-assert" argument to the
> ./configure script. Would that (or --enable-assert) be an option to
> consider?

The asserts indicate when an invalid use of the API is encountered (or a 
bug of course!). When an assert happens it indicates an error condition 
and in pulse, essentially protect against buffer overflows and other 
such conditions.

If the asserts were disabled, then a significant rework in terms of 
error handling would need to be performed. If a catchable error occurs 
in pulse, an assert is not used.

I'm not really sure of the value in disabling asserts. If they are being 
hit, then this just means there are bugs to be fixed!

But perhaps I don't get something here, so will wait for a more 
authoritative answer from Lennart on this :)

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
   Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
   Mandriva Linux Contributor [http://www.mandriva.com/]
   PulseAudio Hacker [http://www.pulseaudio.org/]
   Trac Hacker [http://trac.edgewall.org/]




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux