GCC with -Os warns that the mq_send input may be used uninitialized.
Although for the tests the data content sent is not important, since
both tests checks only if mq_notify was properly set, the warning is
correct and data is indeed uninitialized.
Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
static int
(mqsend) (mqd_t q, int line)
{
- char c;
+ char c = 0;
if (mq_send (q, &c, 1, 1) != 0)
{
printf ("mq_send on line %d failed with: %m\n", line);
static int
(mqsend) (mqd_t q, int line)
{
- char c;
+ char c = 0;
if (mq_send (q, &c, 1, 1) != 0)
{
printf ("mq_send on line %d failed with: %m\n", line);