Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Aug 2015 17:42:05 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        Ian Lepore <ian@freebsd.org>
Cc:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>, John-Mark Gurney <jmg@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r286168 - head/sys/net
Message-ID:  <064AFABE-35B4-48B9-9F95-545792504984@FreeBSD.org>
In-Reply-To: <1438533273.50703.2.camel@freebsd.org>
References:  <201508020015.t720Fr6R018929@repo.freebsd.org> <A1E89852-C155-4630-9729-AAD0AC51F999@lists.zabbadoz.net> <1438533273.50703.2.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2 Aug 2015, at 17:34, Ian Lepore <ian@freebsd.org> wrote:
> 
> It generates a compiler error, so the output is going to contain
> file-and-line like any other compiler error, as well as the message from
> the source code.

It will, of course, vary between compilers, but this is what clang generates:

$ cat static.c 
_Static_assert(0, "example assert failed");
$ cc static.c 
static.c:1:1: error: static_assert failed "example assert failed"
_Static_assert(0, "example assert failed");
^              ~
1 error generated.

GCC 4.8 and later produce very similar output:

$ gcc-4.8 static.c 
static.c:1:1: error: static assertion failed: "example assert failed"
 _Static_assert(0, "example assert failed");
 ^

gcc 4.7 only provides the first line:

$ gcc-4.7 static.c 
static.c:1:1: error: static assertion failed: "example assert failed"

David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?064AFABE-35B4-48B9-9F95-545792504984>