develooper Front page | perl.perl6.internals | Postings from July 2002

The quest for no compiler warnings

From:
Nicholas Clark
Date:
July 13, 2002 16:06
Subject:
The quest for no compiler warnings
Message ID:
20020713215420.GD300@Bagpuss.unfortu.net
On gcc we turn on -Wpadded

In file included from include/parrot/interpreter.h:46,
                 from include/parrot/parrot.h:114,
                 from register.c:13:
include/parrot/op.h:80: warning: padding struct to align `arg_count'

which is this:

typedef struct {
    op_type_t type;
    const char *name;
    const char *full_name;
    const char *func_name;
    const char *body;
    const char jump;
    INTVAL arg_count;           /* Includes opcode as one arg */
    arg_type_t types[PARROT_MAX_ARGS];
    arg_dir_t dirs[PARROT_MAX_ARGS];
} op_info_t;

do we want to leave the warning turned on and have noise, re-order the struct
to avoid the warning, turn the warning off, or "cheat" in some way by changing
what jump is (int, same but 3 more chars after it, anonymous union, bitfield
being 4 ways I can think of that ought to work) ?

Nicholas Clark
-- 
Even better than the real thing:	http://nms-cgi.sourceforge.net/



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About