[apparmor] Rev 2456: Unify escape sequence processing into a set of library fns.

Steve Beattie steve at nxnw.org
Thu Apr 17 17:48:07 UTC 2014


parser: find SIZE_MAX on older versions of glibc and g++

Another issue with commit 2456 is that with older versions of glibc and
g++, a definition for SIZE_MAX was not being found; e.g. on Ubuntu 12.04
LTS and 12.10, the parser fails to compile with the following error:

  g++ -g -O2 -pipe -Wall -Wsign-compare -Wmissing-field-initializers -Wformat-security -Wunused-parameter -std=gnu++0x -D_GNU_SOURCE -DPACKAGE=\"apparmor-parser\" -DLOCALEDIR=\"/usr/share/locale\" -DSUBDOMAIN_CONFDIR=\"/etc/apparmor\" -I../libraries/libapparmor//include -c -o lib.o lib.c
  lib.c: In function 'int str_escseq(const char**, const char*)':
  lib.c:292:32: error: 'SIZE_MAX' was not declared in this scope

The following patch addresses the issue by explicitly including the C stdint
header which contains the definition for SIZE_MAX.

Signed-off-by: Steve Beattie <steve at nxnw.org>
---
 parser/lib.c |    2 ++
 1 file changed, 2 insertions(+)

Index: b/parser/lib.c
===================================================================
--- a/parser/lib.c
+++ b/parser/lib.c
@@ -29,6 +29,8 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <cstdint>
+
 #include "lib.h"
 #include "parser.h"
 

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140417/8997f3cb/attachment.pgp>


More information about the AppArmor mailing list