Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
sac-group
sac2c
Commits
fb545b33
Commit
fb545b33
authored
May 17, 2018
by
Hans-Nikolai Viessmann
Browse files
Merge branch 'gcc8-warning-fixes' into 'develop'
GCC 8 warning fixes [unsure] See merge request
!46
parents
a38b6ad9
cfb15bf7
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/libsac2c/flatten/handle_mops.c
View file @
fb545b33
...
...
@@ -59,15 +59,16 @@ MakePrec (assoc_t assoc, int val)
/******************************************************************************
*
* function:
* prec_t *FreePrec( prec_t * prec)
* prec_t *FreePrec
InLUT
( prec_t * prec
, void * ignored
)
*
* description:
* ...
* Free PREC structure via LUTmap* functions - second argument is unused
* but obligatory with LUTmap* function.
*
******************************************************************************/
static
prec_t
*
FreePrec
(
prec_t
*
prec
)
FreePrec
InLUT
(
prec_t
*
prec
,
void
*
ignored
)
{
DBUG_ENTER
();
...
...
@@ -308,7 +309,7 @@ HMdoHandleMops (node *arg_node)
arg_node
=
TRAVdo
(
arg_node
,
NULL
);
TRAVpop
();
prec_lut
=
LUTmapLutS
(
prec_lut
,
(
void
*
(
*
)(
void
*
,
void
*
))
FreePrec
);
prec_lut
=
LUTmapLutS
(
prec_lut
,
(
void
*
(
*
)(
void
*
,
void
*
))
FreePrec
InLUT
);
prec_lut
=
LUTremoveLut
(
prec_lut
);
DBUG_RETURN
(
arg_node
);
...
...
src/libsac2c/modules/modulemanager.c
View file @
fb545b33
...
...
@@ -472,7 +472,7 @@ MODMgetDeSerializeFunction (const char *name, module_t *module)
result
.
v
=
LIBMgetLibraryFunction
(
name
,
module
->
lib
);
DBUG_RETURN
(
(
serfun_p
)
result
.
f
);
DBUG_RETURN
(
result
.
f
);
}
#undef DBUG_PREFIX
src/libsac2c/print/convert.c
View file @
fb545b33
...
...
@@ -69,16 +69,19 @@ char *
CVfloatvec2String
(
floatvec
val
)
{
char
*
s
;
int
len
;
const
unsigned
vec_len
=
sizeof
(
floatvec
)
/
sizeof
(
float
);
const
unsigned
mem
=
270
*
vec_len
+
vec_len
*
strlen
(
", "
)
+
strlen
(
"(floatvec){}"
);
const
unsigned
buf_size
=
sizeof
(
char
)
*
mem
;
s
=
(
char
*
)
MEMmalloc
(
size
of
(
char
)
*
mem
);
s
printf
(
s
,
"(floatvec){"
);
s
=
(
char
*
)
MEMmalloc
(
buf_
size
);
len
=
sn
printf
(
s
,
buf_size
,
"(floatvec){"
);
for
(
unsigned
i
=
0
;
i
<
vec_len
;
i
++
)
{
char
*
t
=
CVfloat2String
(
FLOATVEC_IDX
(
val
,
i
));
sprintf
(
s
,
"%s%s%s"
,
s
,
t
,
i
==
vec_len
-
1
?
"}"
:
", "
);
/* offset by len to append to string s */
len
+=
snprintf
(
s
+
len
,
buf_size
-
len
,
"%s%s"
,
t
,
i
==
vec_len
-
1
?
"}"
:
", "
);
MEMfree
(
t
);
}
...
...
src/libsac2c/print/print.c
View file @
fb545b33
...
...
@@ -2386,11 +2386,13 @@ PRTfundef (node *arg_node, info *arg_info)
node
*
PRTannotate
(
node
*
arg_node
,
info
*
arg_info
)
{
static
char
strbuffer1
[
256
];
static
char
strbuffer2
[
512
];
str_buf
*
buf1
,
*
buf2
;
DBUG_ENTER
();
buf1
=
SBUFcreate
(
512
);
buf2
=
SBUFcreate
(
512
);
DBUG_PRINT
(
"%s "
F_PTR
,
NODE_TEXT
(
arg_node
),
(
void
*
)
arg_node
);
if
(
NODE_ERROR
(
arg_node
)
!=
NULL
)
{
...
...
@@ -2398,11 +2400,11 @@ PRTannotate (node *arg_node, info *arg_info)
}
if
(
ANNOTATE_TAG
(
arg_node
)
&
CALL_FUN
)
{
s
printf
(
strbuffer
1
,
"PROFILE_BEGIN_UDF( %d, %d)"
,
ANNOTATE_FUNNUMBER
(
arg_node
),
SBUF
printf
(
buf
1
,
"PROFILE_BEGIN_UDF( %d, %d)"
,
ANNOTATE_FUNNUMBER
(
arg_node
),
ANNOTATE_FUNAPNUMBER
(
arg_node
));
}
else
{
if
(
ANNOTATE_TAG
(
arg_node
)
&
RETURN_FROM_FUN
)
{
s
printf
(
strbuffer
1
,
"PROFILE_END_UDF( %d, %d)"
,
SBUF
printf
(
buf
1
,
"PROFILE_END_UDF( %d, %d)"
,
ANNOTATE_FUNNUMBER
(
arg_node
),
ANNOTATE_FUNAPNUMBER
(
arg_node
));
}
else
{
DBUG_UNREACHABLE
(
"wrong tag at N_annotate"
);
...
...
@@ -2410,22 +2412,25 @@ PRTannotate (node *arg_node, info *arg_info)
}
if
(
ANNOTATE_TAG
(
arg_node
)
&
INL_FUN
)
{
s
printf
(
strbuffer
2
,
"PROFILE_INLINE( %s)"
,
strbuffer1
);
SBUF
printf
(
buf
2
,
"PROFILE_INLINE( %s)"
,
SBUFgetBuffer
(
buf1
)
);
if
(
ANNOTATE_TAG
(
arg_node
)
&
LIB_FUN
)
{
s
printf
(
strbuffer
1
,
"PROFILE_LIBRARY( %s)"
,
strbuffer2
);
SBUF
printf
(
buf
1
,
"PROFILE_LIBRARY( %s)"
,
SBUFgetBuffer
(
buf2
)
);
}
else
{
s
printf
(
strbuffer1
,
"%s"
,
strbuffer2
);
SBUF
printf
(
buf1
,
"%s"
,
SBUFgetBuffer
(
buf2
)
);
}
}
else
{
s
printf
(
strbuffer2
,
"%s"
,
strbuffer1
);
SBUF
printf
(
buf2
,
"%s"
,
SBUFgetBuffer
(
buf1
)
);
if
(
ANNOTATE_TAG
(
arg_node
)
&
LIB_FUN
)
{
s
printf
(
strbuffer
1
,
"PROFILE_LIBRARY( %s)"
,
strbuffer2
);
SBUF
printf
(
buf
1
,
"PROFILE_LIBRARY( %s)"
,
SBUFgetBuffer
(
buf2
)
);
}
else
{
s
printf
(
strbuffer1
,
"%s"
,
strbuffer2
);
SBUF
printf
(
buf1
,
"%s"
,
SBUFgetBuffer
(
buf2
)
);
}
}
fprintf
(
global
.
outfile
,
"%s;"
,
strbuffer1
);
fprintf
(
global
.
outfile
,
"%s;"
,
SBUFgetBuffer
(
buf1
));
buf1
=
SBUFfree
(
buf1
);
buf2
=
SBUFfree
(
buf2
);
DBUG_RETURN
(
arg_node
);
}
...
...
src/libsac2c/serialize/deserialize.c
View file @
fb545b33
...
...
@@ -659,7 +659,7 @@ AddEntryToAst (stentry_t *entry, stentrytype_t type, module_t *module)
"module is inconsistent. cannot find function referenced in"
"symbol table"
);
entryp
=
serfun
(
DSstate
);
entryp
=
serfun
();
/* add to ast */
InsertIntoState
(
entryp
,
module
);
...
...
@@ -742,7 +742,7 @@ AddSymbolById (const char *symbid, const char *module, bool resetimport)
DBUG_ASSERT
(
fun
!=
NULL
,
"requested symbol does not exist!"
);
entryp
=
((
serfun0_p
)
fun
)
();
entryp
=
fun
();
/* add to ast */
InsertIntoState
(
entryp
,
mod
);
...
...
@@ -820,7 +820,7 @@ DSimportInstancesByName (const char *name, const char *module)
* even imported.
*/
entryp
=
serfun
(
DSstate
);
entryp
=
serfun
();
/*
* free object wrappers: a wrapper may point to object wrappers which
...
...
@@ -1023,7 +1023,7 @@ DSloadFunctionBody (node *fundef)
"deserializer not found. module seems to be inconsistent!"
);
global
.
valid_ssaform
=
FALSE
;
result
=
((
serfun
0_p
)
serfun
)
();
result
=
serfun
();
global
.
valid_ssaform
=
TRUE
;
SetCurrentFundefHead
(
NULL
);
...
...
src/libsac2c/typecheck/ct_prf.c
View file @
fb545b33
...
...
@@ -21,14 +21,17 @@ ApplyCF (te_info *info, ntype *args)
switch
(
TYgetProductSize
(
args
))
{
case
1
:
res
=
((
monCF
)
TEgetCFFun
(
info
))
(
TYgetValue
(
TYgetProductMember
(
args
,
0
)));
res
=
(
TEgetCFFun
(
info
))
(
TYgetValue
(
TYgetProductMember
(
args
,
0
)),
NULL
,
NULL
);
break
;
case
2
:
res
=
((
binCF
)
TEgetCFFun
(
info
))
(
TYgetValue
(
TYgetProductMember
(
args
,
0
)),
TYgetValue
(
TYgetProductMember
(
args
,
1
)));
res
=
(
TEgetCFFun
(
info
))
(
TYgetValue
(
TYgetProductMember
(
args
,
0
)),
TYgetValue
(
TYgetProductMember
(
args
,
1
)),
NULL
);
break
;
case
3
:
res
=
(
(
triCF
)
TEgetCFFun
(
info
))
(
TYgetValue
(
TYgetProductMember
(
args
,
0
)),
res
=
(
TEgetCFFun
(
info
))
(
TYgetValue
(
TYgetProductMember
(
args
,
0
)),
TYgetValue
(
TYgetProductMember
(
args
,
1
)),
TYgetValue
(
TYgetProductMember
(
args
,
2
)));
break
;
...
...
src/libsac2c/typecheck/split_wrappers.c
View file @
fb545b33
...
...
@@ -144,17 +144,17 @@ SWRmodule (node *arg_node, info *arg_info)
DBUG_RETURN
(
arg_node
);
}
bool
isLocalInstance
(
node
*
fundef
,
bool
result
)
static
bool
*
isLocalInstance
(
node
*
fundef
,
bool
*
result
)
{
DBUG_ENTER
();
result
=
result
|
FUNDEF_ISLOCAL
(
fundef
);
*
result
=
*
result
|
FUNDEF_ISLOCAL
(
fundef
);
DBUG_RETURN
(
result
);
}
bool
static
bool
containsLocalInstances
(
node
*
wrapper
)
{
bool
result
;
...
...
@@ -165,10 +165,11 @@ containsLocalInstances (node *wrapper)
result
=
FUNDEF_ISLOCAL
(
FUNDEF_IMPL
(
wrapper
));
}
else
{
void
*
fold
;
bool
check
=
FALSE
;
fold
=
TYfoldFunctionInstances
(
FUNDEF_WRAPPERTYPE
(
wrapper
),
(
void
*
(
*
)(
node
*
,
void
*
))
isLocalInstance
,
(
void
*
)
FALSE
);
(
void
*
)
&
check
);
/*
* we have to use this instead of casting fold to bool
...
...
src/libsac2c/types/types.h
View file @
fb545b33
...
...
@@ -950,8 +950,12 @@ typedef struct MODULE_T {
int
usecount
;
}
module_t
;
typedef
node
*
(
*
serfun_p
)
(
void
*
);
typedef
node
*
(
*
serfun0_p
)
(
void
);
/*
* The serfun_* types are used by modulemanager and the serialise/de-serialise
* traversals to access serialised functions. The functions are *never* defined
* as having an argument (i.e. void *(*)(void)).
*/
typedef
node
*
(
*
serfun_p
)
(
void
);
typedef
union
{
void
*
v
;
...
...
Sven-Bodo Scholz
@sbs
mentioned in issue
#2226 (closed)
·
May 22, 2018
mentioned in issue
#2226 (closed)
mentioned in issue #2226
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment