C-sparse

 view release on metacpan or  search on metacpan

src/sparse-0.4.4/cgcc  view on Meta::CPAN

    exec ($cc);
}

exit 0;

# -----------------------------------------------------------------------------
# Check if an option is for "check" only.

sub check_only_option {
    my ($arg) = @_;
    return 1 if $arg =~ /^-W(no-?)?(default-bitfield-sign|one-bit-signed-bitfield|cast-truncate|bitwise|typesign|context|undef|ptr-subtraction-blows|cast-to-as|decl|transparent-union|address-space|enum-mismatch|do-while|old-initializer|non-pointer-nu...
    return 1 if $arg =~ /^-v(no-?)?(entry|dead)$/;
    return 0;
}

# -----------------------------------------------------------------------------
# Simple arg-quoting function.  Just adds backslashes when needed.

sub quote_arg {
    my ($arg) = @_;
    return "''" if $arg eq '';

src/sparse-0.4.4/ctx.c  view on Meta::CPAN

	{ "do-while", &ctx-> Wdo_while },
	{ "enum-mismatch", &ctx-> Wenum_mismatch },
	{ "init-cstring", &ctx-> Winit_cstring },
	{ "non-pointer-null", &ctx-> Wnon_pointer_null },
	{ "old-initializer", &ctx-> Wold_initializer },
	{ "one-bit-signed-bitfield", &ctx-> Wone_bit_signed_bitfield },
	{ "paren-string", &ctx-> Wparen_string },
	{ "ptr-subtraction-blows", &ctx-> Wptr_subtraction_blows },
	{ "return-void", &ctx-> Wreturn_void },
	{ "shadow", &ctx-> Wshadow },
	{ "transparent-union", &ctx-> Wtransparent_union },
	{ "typesign", &ctx-> Wtypesign },
	{ "undef", &ctx-> Wundef },
	{ "uninitialized", &ctx-> Wuninitialized },
	{ "vla", &ctx-> Wvla },
	};
	memcpy(ctx->warnings, warnings, sizeof(ctx->warnings));
	
	struct warning debugs[DCNT] = {
	{ "entry", &ctx->dbg_entry},
	{ "dead", &ctx->dbg_dead},

src/sparse-0.4.4/ctx.h  view on Meta::CPAN

	int Wdo_while /*= 0*/;
	int Winit_cstring /*= 0*/;
	int Wenum_mismatch /*= 1*/;
	int Wnon_pointer_null /*= 1*/;
	int Wold_initializer /*= 1*/;
	int Wone_bit_signed_bitfield /*= 1*/;
	int Wparen_string /*= 0*/;
	int Wptr_subtraction_blows /*= 0*/;
	int Wreturn_void /*= 0*/;
	int Wshadow /*= 0*/;
	int Wtransparent_union /*= 0*/;
	int Wtypesign /*= 0*/;
	int Wundef /*= 0*/;
	int Wuninitialized /*= 1*/;
	int Wvla /*= 1*/;
	
	int dbg_entry /*= 0*/;
	int dbg_dead /*= 0*/;
	
	int preprocess_only;

src/sparse-0.4.4/ident-list.h  view on Meta::CPAN

IDENT(sentinel); IDENT(__sentinel__);
IDENT(alias); IDENT(__alias__);
IDENT(pure); IDENT(__pure__);
IDENT(always_inline); IDENT(__always_inline__);
IDENT(syscall_linkage); IDENT(__syscall_linkage__);
IDENT(visibility); IDENT(__visibility__);
IDENT(bitwise); IDENT(__bitwise__);
IDENT(model); IDENT(__model__);
IDENT(format_arg); IDENT(__format_arg__);
IDENT(nothrow); IDENT(__nothrow); IDENT(__nothrow__);
IDENT(__transparent_union__);
IDENT(malloc);
IDENT(__malloc__);
IDENT(nonnull); IDENT(__nonnull); IDENT(__nonnull__);
IDENT(constructor); IDENT(__constructor__);
IDENT(destructor); IDENT(__destructor__);
IDENT(cold); IDENT(__cold__);
IDENT(hot); IDENT(__hot__);
IDENT(cdecl); IDENT(__cdecl__);
IDENT(stdcall); IDENT(__stdcall__);
IDENT(fastcall); IDENT(__fastcall__);

src/sparse-0.4.4/lib.c  view on Meta::CPAN

int Wdo_while = 0;
int Winit_cstring = 0;
int Wenum_mismatch = 1;
int Wnon_pointer_null = 1;
int Wold_initializer = 1;
int Wone_bit_signed_bitfield = 1;
int Wparen_string = 0;
int Wptr_subtraction_blows = 0;
int Wreturn_void = 0;
int Wshadow = 0;
int Wtransparent_union = 0;
int Wtypesign = 0;
int Wundef = 0;
int Wuninitialized = 1;
int Wvla = 1;

int dbg_entry = 0;
int dbg_dead = 0;

int preprocess_only;

src/sparse-0.4.4/lib.c  view on Meta::CPAN

	{ "do-while", &Wdo_while },
	{ "enum-mismatch", &Wenum_mismatch },
	{ "init-cstring", &Winit_cstring },
	{ "non-pointer-null", &Wnon_pointer_null },
	{ "old-initializer", &Wold_initializer },
	{ "one-bit-signed-bitfield", &Wone_bit_signed_bitfield },
	{ "paren-string", &Wparen_string },
	{ "ptr-subtraction-blows", &Wptr_subtraction_blows },
	{ "return-void", &Wreturn_void },
	{ "shadow", &Wshadow },
	{ "transparent-union", &Wtransparent_union },
	{ "typesign", &Wtypesign },
	{ "undef", &Wundef },
	{ "uninitialized", &Wuninitialized },
	{ "vla", &Wvla },
};
#endif 

enum {
	WARNING_OFF,
	WARNING_ON,

src/sparse-0.4.4/lib.h  view on Meta::CPAN

extern int Wdo_while;
extern int Wenum_mismatch;
extern int Winit_cstring;
extern int Wnon_pointer_null;
extern int Wold_initializer;
extern int Wone_bit_signed_bitfield;
extern int Wparen_string;
extern int Wptr_subtraction_blows;
extern int Wreturn_void;
extern int Wshadow;
extern int Wtransparent_union;
extern int Wtypesign;
extern int Wundef;
extern int Wuninitialized;
extern int Wvla;

extern int dbg_entry;
extern int dbg_dead;

extern int arch_m64;
extern int arch_msize_long;

src/sparse-0.4.4/parse.c  view on Meta::CPAN

static struct token *toplevel_asm_declaration(SCTX_ struct token *token, struct symbol_list **list);

typedef struct token *attr_t(SCTX_ 
struct token *, struct symbol *,
			     struct decl_state *);

static attr_t
	attribute_packed, attribute_aligned, attribute_modifier,
	attribute_address_space, attribute_context,
	attribute_designated_init,
	attribute_transparent_union, ignore_attribute,
	attribute_mode, attribute_force;

typedef struct symbol *to_mode_t(SCTX_ struct symbol *);

static to_mode_t
	to_QI_mode, to_HI_mode, to_SI_mode, to_DI_mode, to_TI_mode, to_word_mode;

enum {
	Set_T = 1,
	Set_S = 2,

src/sparse-0.4.4/parse.c  view on Meta::CPAN

};

static struct symbol_op context_op = {
	.attribute = attribute_context,
};

static struct symbol_op designated_init_op = {
	.attribute = attribute_designated_init,
};

static struct symbol_op transparent_union_op = {
	.attribute = attribute_transparent_union,
};

static struct symbol_op ignore_attr_op = {
	.attribute = ignore_attribute,
};

static struct symbol_op mode_QI_op = {
	.type = KW_MODE,
	.to_mode = to_QI_mode
};

src/sparse-0.4.4/parse.c  view on Meta::CPAN

	{ "nocast",	NS_KEYWORD,	MOD_NOCAST,	.op = &attr_mod_op },
	{ "noderef",	NS_KEYWORD,	MOD_NODEREF,	.op = &attr_mod_op },
	{ "safe",	NS_KEYWORD,	MOD_SAFE, 	.op = &attr_mod_op },
	{ "force",	NS_KEYWORD,	.op = &attr_force_op },
	{ "bitwise",	NS_KEYWORD,	MOD_BITWISE,	.op = &attr_mod_op },
	{ "__bitwise__",NS_KEYWORD,	MOD_BITWISE,	.op = &attr_mod_op },
	{ "address_space",NS_KEYWORD,	.op = &address_space_op },
	{ "mode",	NS_KEYWORD,	.op = &mode_op },
	{ "context",	NS_KEYWORD,	.op = &context_op },
	{ "designated_init",	NS_KEYWORD,	.op = &designated_init_op },
	{ "__transparent_union__",	NS_KEYWORD,	.op = &transparent_union_op },
	{ "noreturn",	NS_KEYWORD,	MOD_NORETURN,	.op = &attr_mod_op },
	{ "__noreturn__",	NS_KEYWORD,	MOD_NORETURN,	.op = &attr_mod_op },
	{ "pure",	NS_KEYWORD,	MOD_PURE,	.op = &attr_mod_op },
	{"__pure__",	NS_KEYWORD,	MOD_PURE,	.op = &attr_mod_op },
	{"const",	NS_KEYWORD,	MOD_PURE,	.op = &attr_mod_op },
	{"__const",	NS_KEYWORD,	MOD_PURE,	.op = &attr_mod_op },
	{"__const__",	NS_KEYWORD,	MOD_PURE,	.op = &attr_mod_op },

	{ "__mode__",	NS_KEYWORD,	.op = &mode_op },
	{ "QI",		NS_KEYWORD,	MOD_CHAR,	.op = &mode_QI_op },

src/sparse-0.4.4/parse.c  view on Meta::CPAN


static struct token *attribute_designated_init(SCTX_ struct token *token, struct symbol *attr, struct decl_state *ctx)
{
	if (ctx->ctype.base_type && ctx->ctype.base_type->type == SYM_STRUCT)
		ctx->ctype.base_type->designated_init = 1;
	else
		warning(sctx_ token->pos, "attribute designated_init applied to non-structure type");
	return token;
}

static struct token *attribute_transparent_union(SCTX_ struct token *token, struct symbol *attr, struct decl_state *ctx)
{
	if (sctxp Wtransparent_union)
		warning(sctx_ token->pos, "ignoring attribute __transparent_union__");
	return token;
}

static struct token *recover_unknown_attribute(SCTX_ struct token *token)
{
	struct expression *expr = NULL;

	sparse_error(sctx_ token->pos, "attribute '%s': unknown attribute", show_ident(sctx_ token->ident));
	token = token->next;
	if (match_op(token, '('))

src/sparse-0.4.4/perl/t/include/ui/console.h  view on Meta::CPAN


QEMUCursor *cursor_alloc(int width, int height);
void cursor_get(QEMUCursor *c);
void cursor_put(QEMUCursor *c);
QEMUCursor *cursor_builtin_hidden(void);
QEMUCursor *cursor_builtin_left_ptr(void);
void cursor_print_ascii_art(QEMUCursor *c, const char *prefix);
int cursor_get_mono_bpl(QEMUCursor *c);
void cursor_set_mono(QEMUCursor *c,
                     uint32_t foreground, uint32_t background, uint8_t *image,
                     int transparent, uint8_t *mask);
void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *mask);
void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask);

typedef struct DisplayChangeListenerOps {
    const char *dpy_name;

    void (*dpy_refresh)(DisplayChangeListener *dcl);

    void (*dpy_gfx_update)(DisplayChangeListener *dcl,
                           int x, int y, int w, int h);
    void (*dpy_gfx_switch)(DisplayChangeListener *dcl,
                           struct DisplaySurface *new_surface);

src/sparse-0.4.4/sparse.1  view on Meta::CPAN

.TP
.B \-Wshadow
Warn when declaring a symbol which shadows a declaration with the same name in
an outer scope.

Such declarations can lead to error-prone code.

Sparse does not issue these warnings by default.
.
.TP
.B \-Wtransparent\-union
Warn about any declaration using the GCC extension
\fB__attribute__((transparent_union))\fR.

Sparse issues these warnings by default.  To turn them off, use
\fB\-Wno\-transparent\-union\fR.
.
.TP
.B \-Wtypesign
Warn when converting a pointer to an integer type into a pointer to an integer
type with different signedness.

Sparse does not issue these warnings by default.
.
.TP
.B \-Wundef

src/sparse-0.4.4/validation/phase2/backslash  view on Meta::CPAN

 * [5.1.1.2(1.2)]:
 *   Each instance of a backslash character (\) immediately followed by
 *   a new-line character is deleted, splicing physical source lines to
 *   form logical source lines.  Only the last backslash on any physical
 *   source line shall be eligible for being part of such a splice.
 *   A source file that is not empty shall end in a new-line character,
 *   which shall not be immediately preceded by a backslash character
 *   before any such splicing takes place.
 *
 * Note that this happens on the phase 2, before we even think of any
 * tokens.  In other words, splicing is ignorant of and transparent for
 * the rest of tokenizer.
 */

#define A(x) #x
#define B(x) A(x)
/* This should result in "\a" */
/* XXX: currently sparse produces "a" */
/* Partially fixed: now it gives "\\a", which is a separate problem */
B(\a)



( run in 0.946 second using v1.01-cache-2.11-cpan-a1d94b6210f )