Skip to contentSkip to conversation

: timer.h doesn't compile with -ansi

ALSA - lib 0002256 [email protected] 1 participant 1 message Jul 5, 2006

lore
Share & tools
lore
#0 lore raw

A NOTE has been added to this issue.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=2256>
======================================================================
Reported By: joeljkp
Assigned To:
======================================================================

Project:                    ALSA - lib
Issue ID:                   2256
Category:                   0_general
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             07-04-2006 05:51 CEST
Last Modified:              07-05-2006 15:31 CEST

======================================================================
Summary: timer.h doesn't compile with -ansi
Description:
timer.h causes programs not to compile with gcc 4.0.3 and -ansi:

$ cat test.c
#include <alsa/asoundlib.h>
$ cc -c -ansi test.c
In file included from /usr/include/alsa/asoundlib.h:51,
                 from test.c:1:
/usr/include/alsa/timer.h:108: error: field &#8216;tstamp&#8217; has
incomplete type
$
======================================================================

----------------------------------------------------------------------
joeljkp - 07-04-06 07:01
----------------------------------------------------------------------
Adding the following line at the top of asoundlib.h, timer.h, or above the #include <time.h> in global.h fixes the problem.

#define _POSIX_C_SOURCE 199506L

----------------------------------------------------------------------
tiwai - 07-05-06 15:31
----------------------------------------------------------------------
The patch results in compile warnings of alsa-lib itself. I'm also a bit concerned to define it in that place, too...

Issue History
Date Modified Username Field Change
======================================================================

07-04-06 05:51 joeljkp        New Issue                                    
07-04-06 05:52 joeljkp        Issue Monitored: joeljkp                     
07-04-06 07:01 joeljkp        Note Added: 0010815                          
07-04-06 18:43 joeljkp        File Added: bug2256.patch                    
07-05-06 15:31 tiwai          Note Added: 0010840                          

======================================================================

Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642