Bug 90881 - _FILE_OFFSET_BITS redefined warnings when building echo-cancel module
Summary: _FILE_OFFSET_BITS redefined warnings when building echo-cancel module
Status: RESOLVED FIXED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: modules (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-05 23:33 UTC by shawn.walker@oracle.com
Modified: 2015-06-12 07:18 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
fix include file order for echo-cancel module (516 bytes, text/plain)
2015-06-05 23:33 UTC, shawn.walker@oracle.com
Details
Add config.h (868 bytes, patch)
2015-06-11 11:49 UTC, David Henningsson
Details | Splinter Review

Description shawn.walker@oracle.com 2015-06-05 23:33:19 UTC
Created attachment 116330 [details]
fix include file order for echo-cancel module

When building the echo-cancel module on some platforms, the compiler may warn about _FILE_OFFSET_BITS being redefined because of the include file ordering in adrian-aec.c

Notably, it includes string.h before including adrain-aec.h where config.h is included.  This prevents various feature tests done in system header files from being able to properly define _FILE_OFFSET_BITS first which triggers a redefinition later.
Comment 1 David Henningsson 2015-06-11 11:48:34 UTC
Hi,

I get compilation errors when I test your patch, this one and then some more:

../../src/modules/echo-cancel/adrian-aec.h:242:26: error: 'M_PI' undeclared (first use in this function)
     i->b1 = expf(-2.0f * M_PI * Fc);
Comment 2 David Henningsson 2015-06-11 11:49:21 UTC
Created attachment 116433 [details] [review]
Add config.h

Could you test this patch instead and see if resolves your issue?
Comment 3 shawn.walker@oracle.com 2015-06-11 20:32:43 UTC
The compilation errors are likely due to platform differences; I promise the patch I provided works as expected here :-)

With that said, your alternative patch also works, so I'm fine with that fix instead; it's probably the more portable fix.


FYI, this is the warning that was originally seen:

  CC       modules/echo-cancel/module_echo_cancel_la-adrian-aec.lo
In file included from /builds/pulseaudio-6.0/src/modules/echo-cancel/adrian-aec.h:17:0,
                 from /builds/pulseaudio-6.0/src/modules/echo-cancel/adrian-aec.c:23:
../config.h:698:0: warning: "_FILE_OFFSET_BITS" redefined [enabled by default]
 #define _FILE_OFFSET_BITS 64
 ^
In file included from /usr/include/iso/math_iso.h:12:0,
                 from /usr/include/math.h:12,
                 from /builds/pulseaudio-6.0/src/modules/echo-cancel/adrian-aec.c:17:
/usr/include/sys/feature_tests.h:214:0: note: this is the location of the previous definition
 #define _FILE_OFFSET_BITS 32
 ^
Comment 4 Arun Raghavan 2015-06-12 07:18:37 UTC
Pushed David's patch.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.