From d18caa4fe1ba16ef65dd8198eb160d5b238c4c8d Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 7 Aug 2011 10:00:45 +0000 Subject: [PATCH] fix a `strict-aliasing' warning --- ChangeLog | 7 +++++++ src/frontend/shyu.c | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19f4315d0..1003f8af1 100644 --- a/ChangeLog +++ b/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 diff --git a/src/frontend/shyu.c b/src/frontend/shyu.c index 823d99391..f870297b4 100644 --- a/src/frontend/shyu.c +++ b/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;