Skip to content

Commit d77df81

Browse files
committed
Got tired of waiting for spoonbill's compiler to get fixed. Let's
see if using an intermediate variable avoids the gcc bug.
1 parent 87e8014 commit d77df81

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

contrib/seg/segparse.y

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111

1212
extern int seg_yylex(void);
1313

14-
extern int significant_digits( char *str ); /* defined in seg.c */
14+
extern int significant_digits(char *str); /* defined in seg.c */
1515

1616
void seg_yyerror(const char *message);
1717
int seg_yyparse(void *result);
1818

19-
float seg_atof( char *value );
19+
static float seg_atof(char *value);
2020

21-
long threshold;
22-
char strbuf[25] = {
21+
static char strbuf[25] = {
2322
'0', '0', '0', '0', '0',
2423
'0', '0', '0', '0', '0',
2524
'0', '0', '0', '0', '0',
@@ -108,30 +107,39 @@ range:
108107

109108
boundary:
110109
SEGFLOAT {
111-
$$.ext = '\0';
112-
$$.sigd = significant_digits($1);
113-
$$.val = seg_atof($1);
110+
/* temp variable avoids a gcc 3.3.x bug on Sparc64 */
111+
float val = seg_atof($1);
112+
113+
$$.ext = '\0';
114+
$$.sigd = significant_digits($1);
115+
$$.val = val;
114116
}
115117
|
116118
EXTENSION SEGFLOAT {
117-
$$.ext = $1[0];
118-
$$.sigd = significant_digits($2);
119-
$$.val = seg_atof($2);
119+
/* temp variable avoids a gcc 3.3.x bug on Sparc64 */
120+
float val = seg_atof($2);
121+
122+
$$.ext = $1[0];
123+
$$.sigd = significant_digits($2);
124+
$$.val = val;
120125
}
121126
;
122127

123128
deviation:
124129
SEGFLOAT {
125-
$$.ext = '\0';
126-
$$.sigd = significant_digits($1);
127-
$$.val = seg_atof($1);
130+
/* temp variable avoids a gcc 3.3.x bug on Sparc64 */
131+
float val = seg_atof($1);
132+
133+
$$.ext = '\0';
134+
$$.sigd = significant_digits($1);
135+
$$.val = val;
128136
}
129137
;
130138

131139
%%
132140

133141

134-
float
142+
static float
135143
seg_atof(char *value)
136144
{
137145
Datum datum;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy