fix a `strict-aliasing' warning

This commit is contained in:
rlar 2011-08-07 10:00:45 +00:00
parent 4f5d6aa770
commit d18caa4fe1
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2011-08-07 Robert Larice
* src/frontend/shyu.c :
fix a `strict-aliasing' warning
warning: dereferencing pointer 'current' does break strict-aliasing rules
FIXME, this code is, and was broken.
in if_sens_run() error messages are generated, and then ignored.
2011-08-07 Robert Larice
* configure.ac :
use -O1 when debugging, otherwise gcc ignores -Wuninitialized

View File

@ -38,7 +38,7 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
char *steptype;
char *name;
char *line;
struct line deck;
card deck;
int i;
int j;
int error;
@ -47,10 +47,13 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
int which = -1;
(void) sprintf(buf, ".%s", wl_flatten(args));
deck.li_next = deck.li_actual = NULL;
deck.li_error = NULL;
deck.li_linenum = 0;
deck.li_line = buf;
deck.nextcard = NULL;
deck.actualLine = NULL;
deck.error = NULL;
deck.linenum = 0;
deck.linenum_orig = 0;
deck.line = buf;
current = (card *) &deck;
line = current->line;