FreeBSD/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c
/*
 * The #pragma error directive can be followed by any list of tokens, which we
 * just concatenate and print as part of our error message.
 */
The #pragma error directive can be followed by any list of tokens, which we
just concatenate and print as part of our error message.
The #pragma error directive can be followed by any list of tokens which we just concatenate and print as part of our error message .
static void
dt_pragma_error(const char *prname, dt_node_t *dnp)
{
	dt_node_t *enp;
	size_t n = 0;
	char *s;
	for (enp = dnp; enp != NULL; enp = enp->dn_list) {
		if (enp->dn_kind == DT_NODE_IDENT ||
		    enp->dn_kind == DT_NODE_STRING)
			n += strlen(enp->dn_string) + 1;
	}
	s = alloca(n + 1);
	s[0] = '\0';
	for (enp = dnp; enp != NULL; enp = enp->dn_list) {
		if (enp->dn_kind == DT_NODE_IDENT ||
		    enp->dn_kind == DT_NODE_STRING) {
			(void) strcat(s, enp->dn_string);
			(void) strcat(s, " ");
		}
	}
	xyerror(D_PRAGERR, "#%s: %s\n", prname, s);
}
static void dt_pragma_error ( const char * prname , dt_node_t * dnp ) { dt_node_t * enp ; size_t n = 0 ; char * s ; for ( enp = dnp ; enp != NULL ; enp = enp -> dn_list ) { if ( enp -> dn_kind == DT_NODE_IDENT || enp -> dn_kind == DT_NODE_STRING ) n += strlen ( enp -> dn_string ) + 1 ; } s = alloca ( n + 1 ) ; s [ 0 ] = ' \0 ' ; for ( enp = dnp ; enp != NULL ; enp = enp -> dn_list ) { if ( enp -> dn_kind == DT_NODE_IDENT || enp -> dn_kind == DT_NODE_STRING ) { ( void ) strcat ( s , enp -> dn_string ) ; ( void ) strcat ( s , " " ) ; } } xyerror ( D_PRAGERR , " \n " , prname , s ) ; }
The #pragma error directive can be followed by any list of tokens, which we
 just concatenate and print as part of our error message.
The #pragma error directive can be followed by any list of tokens which we just concatenate and print as part of our error message .