media/libcubeb/tests/test_tone.cpp:20: throw_gcc.h:116:5: error: use of undeclared identifier 'snprintf'

RESOLVED FIXED

Status

()

Core
Audio/Video: cubeb
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Jan Beich, Unassigned)

Tracking

Trunk
Unspecified
FreeBSD
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox45 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
snprintf() wasn't defined before SUSv6 aka POSIX.1-2001.

  c++ -o test_tone.o -c -I../../../dist/stl_wrappers -I../../../dist/system_wrappers -include /mozilla-central/config/gcc_hidden.h  -I/mozilla-central/media/libcubeb/tests -I. -I/mozilla-central/media/libcubeb/include -I../../../dist/include  -I../../../dist/include/testing -I/objdir/dist/include/nspr -I/objdir/dist/include/nss       -fPIC  -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MP -MF .deps/test_tone.o.pp -Qunused-arguments   -I/usr/local/include -Qunused-arguments -Wno-unused-local-typedef -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wno-inline-new-delete -Wno-unused-local-typedef -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pipe  -DNDEBUG -DTRIMMED -O -fomit-frame-pointer     /mozilla-central/media/libcubeb/tests/test_tone.cpp
  In file included from /mozilla-central/media/libcubeb/tests/test_tone.cpp:20:
  In file included from ../../../dist/include/testing/TestHarness.h:18:
  In file included from ../../../dist/include/nsComponentManagerUtils.h:10:
  In file included from ../../../dist/include/nscore.h:20:
  In file included from ../../../dist/include/mozilla/mozalloc.h:18:
  In file included from ../../../dist/stl_wrappers/new:61:
  ../../../dist/include/mozilla/throw_gcc.h:116:5: error: use of undeclared identifier 'snprintf'
      snprintf(error, sizeof(error)-1,
      ^
  In file included from /mozilla-central/media/libcubeb/tests/test_tone.cpp:20:
  In file included from ../../../dist/include/testing/TestHarness.h:22:
  In file included from ../../../dist/include/nsStringGlue.h:21:
  In file included from ../../../dist/include/nsStringAPI.h:25:
  In file included from ../../../dist/include/nsTArray.h:16:
  In file included from ../../../dist/include/mozilla/MathAlgorithms.h:15:
  In file included from ../../../dist/stl_wrappers/cmath:50:
  /usr/include/c++/v1/cmath:638:9: error: no member named 'signbit' in the global namespace
  using ::signbit;
	~~^
  /usr/include/c++/v1/cmath:639:9: error: no member named 'fpclassify' in the global namespace
  using ::fpclassify;
	~~^
  /usr/include/c++/v1/cmath:640:9: error: no member named 'isfinite' in the global namespace; did you mean
	'__isfinite'?
  using ::isfinite;
	~~^
  /usr/include/math.h:184:5: note: '__isfinite' declared here
  int     __isfinite(double) __pure2;
	  ^
  In file included from /mozilla-central/media/libcubeb/tests/test_tone.cpp:20:
  In file included from ../../../dist/include/testing/TestHarness.h:22:
  In file included from ../../../dist/include/nsStringGlue.h:21:
  In file included from ../../../dist/include/nsStringAPI.h:25:
  In file included from ../../../dist/include/nsTArray.h:16:
  In file included from ../../../dist/include/mozilla/MathAlgorithms.h:15:
  In file included from ../../../dist/stl_wrappers/cmath:50:
  /usr/include/c++/v1/cmath:643:9: error: no member named 'isnormal' in the global namespace; did you mean
	'__isnormal'?
  using ::isnormal;
	~~^
  /usr/include/math.h:190:5: note: '__isnormal' declared here
  int     __isnormal(double) __pure2;
	  ^
  In file included from /mozilla-central/media/libcubeb/tests/test_tone.cpp:20:
  In file included from ../../../dist/include/testing/TestHarness.h:22:
  In file included from ../../../dist/include/nsStringGlue.h:21:
  In file included from ../../../dist/include/nsStringAPI.h:25:
  In file included from ../../../dist/include/nsTArray.h:16:
  In file included from ../../../dist/include/mozilla/MathAlgorithms.h:15:
  In file included from ../../../dist/stl_wrappers/cmath:50:
  /usr/include/c++/v1/cmath:644:9: error: no member named 'isgreater' in the global namespace
  using ::isgreater;
	~~^
  /usr/include/c++/v1/cmath:645:9: error: no member named 'isgreaterequal' in the global namespace
  using ::isgreaterequal;
	~~^
  /usr/include/c++/v1/cmath:646:9: error: no member named 'isless' in the global namespace
  using ::isless;
	~~^
  /usr/include/c++/v1/cmath:647:9: error: no member named 'islessequal' in the global namespace
  using ::islessequal;
	~~^
  /usr/include/c++/v1/cmath:648:9: error: no member named 'islessgreater' in the global namespace
  using ::islessgreater;
	~~^
  /usr/include/c++/v1/cmath:649:9: error: no member named 'isunordered' in the global namespace
  using ::isunordered;
	~~^
  /usr/include/c++/v1/cmath:650:9: error: no member named 'isunordered' in the global namespace
  using ::isunordered;
	~~^
  /usr/include/c++/v1/cmath:652:9: error: no member named 'float_t' in the global namespace; did you mean
	'__float_t'?
  using ::float_t;
	~~^
  /usr/include/x86/_types.h:80:16: note: '__float_t' declared here
  typedef float           __float_t;
			  ^
  In file included from /mozilla-central/media/libcubeb/tests/test_tone.cpp:20:
  In file included from ../../../dist/include/testing/TestHarness.h:22:
  In file included from ../../../dist/include/nsStringGlue.h:21:
  In file included from ../../../dist/include/nsStringAPI.h:25:
  In file included from ../../../dist/include/nsTArray.h:16:
  In file included from ../../../dist/include/mozilla/MathAlgorithms.h:15:
  In file included from ../../../dist/stl_wrappers/cmath:50:
  /usr/include/c++/v1/cmath:653:9: error: no member named 'double_t' in the global namespace; did you mean
	'__double_t'?
  using ::double_t;
	~~^
  /usr/include/x86/_types.h:79:17: note: '__double_t' declared here
  typedef double          __double_t;
			  ^
  In file included from /mozilla-central/media/libcubeb/tests/test_tone.cpp:20:
  In file included from ../../../dist/include/testing/TestHarness.h:22:
  In file included from ../../../dist/include/nsStringGlue.h:21:
  In file included from ../../../dist/include/nsStringAPI.h:25:
  In file included from ../../../dist/include/nsTArray.h:16:
  In file included from ../../../dist/include/mozilla/MathAlgorithms.h:15:
  In file included from ../../../dist/stl_wrappers/cmath:50:
  /usr/include/c++/v1/cmath:664:39: error: use of undeclared identifier 'fabsf'; did you mean 'fabs'?
  abs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
					^
  /usr/include/math.h:255:8: note: 'fabs' declared here
  double  fabs(double) __pure2;
	  ^
  In file included from /mozilla-central/media/libcubeb/tests/test_tone.cpp:20:
  In file included from ../../../dist/include/testing/TestHarness.h:22:
  In file included from ../../../dist/include/nsStringGlue.h:21:
  In file included from ../../../dist/include/nsStringAPI.h:25:
  In file included from ../../../dist/include/nsTArray.h:16:
  In file included from ../../../dist/include/mozilla/MathAlgorithms.h:15:
  In file included from ../../../dist/stl_wrappers/cmath:50:
  /usr/include/c++/v1/cmath:672:45: error: use of undeclared identifier 'fabsl'; did you mean 'fabs'?
  abs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
					      ^
  /usr/include/math.h:255:8: note: 'fabs' declared here
  double  fabs(double) __pure2;
	  ^
  In file included from /mozilla-central/media/libcubeb/tests/test_tone.cpp:20:
  In file included from ../../../dist/include/testing/TestHarness.h:22:
  In file included from ../../../dist/include/nsStringGlue.h:21:
  In file included from ../../../dist/include/nsStringAPI.h:25:
  In file included from ../../../dist/include/nsTArray.h:16:
  In file included from ../../../dist/include/mozilla/MathAlgorithms.h:15:
  In file included from ../../../dist/stl_wrappers/cmath:50:
  /usr/include/c++/v1/cmath:680:9: error: no member named 'acosf' in the global namespace
  using ::acosf;
	~~^
  /usr/include/c++/v1/cmath:683:91: error: use of undeclared identifier 'acosf'
  inline _LIBCPP_INLINE_VISIBILITY float       acos(float __lcpp_x) _NOEXCEPT       {return acosf(__...
											    ^
  /usr/include/c++/v1/cmath:684:91: error: use of undeclared identifier 'acosl'
  inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);}
											    ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
(Reporter)

Comment 1

2 years ago
Created attachment 8692403 [details] [diff] [review]
Raise POSIX level

Alternatively, it can also be fixed by
- Moving TestHarness.h before _XOPEN_SOURCE
- Undefining _XOPEN_SOURCE for MOZILLA_CLIENT
Attachment #8692403 - Flags: review?(kinetik)
Comment on attachment 8692403 [details] [diff] [review]
Raise POSIX level

Thanks.  This fix is good because TestHarness.h isn't available in builds outside of Gecko.  Please don't land this patch directly -- I'll upstream the fix and include it in the update in bug 1225703.
Attachment #8692403 - Flags: review?(kinetik) → review+
(Reporter)

Comment 5

2 years ago
Builds fine now and as long as bug 1219480 and bug 1225703 stay on the same release train. Thanks.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
(Reporter)

Updated

2 years ago
status-firefox45: affected → fixed
You need to log in before you can comment on or make changes to this bug.