[apparmor] [patch] regression tests: fix gcc-5 inline confusion
Steve Beattie
steve at nxnw.org
Tue Mar 3 19:01:10 UTC 2015
On Tue, Mar 03, 2015 at 10:58:57AM -0800, Steve Beattie wrote:
> Parts of the regression tests that use the do_open() inline function
> from changehat.h fail to build under gcc-5 like so:
>
> cc -g -O0 -Wall -Wstrict-prototypes changeprofile.c -lapparmor -o changeprofile
> /tmp/ccT6GE6k.o: In function `main':
> /home/ubuntu/bzr/apparmor/tests/regression/apparmor/changeprofile.c:43: undefined reference to `do_open'
> collect2: error: ld returned 1 exit status
> <builtin>: recipe for target 'changeprofile' failed
>
> This patch converts the do_open function declaration to be static
> inline, which apparently keeps gcc-5 from getting confused.
Oh, it's intended for both trunk and 2.9. Thanks.
> Signed-off-by: Steve Beattie <steve at nxnw.org>
> ---
> tests/regression/apparmor/changehat.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: b/tests/regression/apparmor/changehat.h
> ===================================================================
> --- a/tests/regression/apparmor/changehat.h
> +++ b/tests/regression/apparmor/changehat.h
> @@ -4,7 +4,7 @@
>
> #define SD_ID_MAGIC 0x8c235e38
>
> -inline int do_open (char * file)
> +static inline int do_open (char * file)
> {
> int fd, rc;
> char buf[128];
--
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/20150303/580149d2/attachment.pgp>
More information about the AppArmor
mailing list