Browse Source

fix a `strict-aliasing' warning

rlar 15 years ago
parent
commit
d18caa4fe1
  1. 7
      ChangeLog
  2. 13
      src/frontend/shyu.c

7
ChangeLog

@ -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

13
src/frontend/shyu.c

@ -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;

Loading…
Cancel
Save