Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
e1201d73
Commit
e1201d73
authored
Apr 26, 2021
by
Mark Olesen
Browse files
COMP: sign check to avoid warnings about new[] range
parent
9aea491e
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/Lists/List/List.C
View file @
e1201d73
...
...
@@ -50,6 +50,7 @@ void Foam::List<T>::doResize(const label newSize)
{
if
(
newSize
>
0
)
{
// With sign-check to avoid spurious -Walloc-size-larger-than
T
*
nv
=
new
T
[
newSize
];
const
label
overlap
=
min
(
this
->
size_
,
newSize
);
...
...
src/OpenFOAM/containers/Lists/List/ListI.H
View file @
e1201d73
...
...
@@ -31,8 +31,9 @@ License
template
<
class
T
>
inline
void
Foam
::
List
<
T
>::
doAlloc
()
{
if
(
this
->
size_
)
if
(
this
->
size_
>
0
)
{
// With sign-check to avoid spurious -Walloc-size-larger-than
this
->
v_
=
new
T
[
this
->
size_
];
}
}
...
...
src/OpenFOAM/matrices/Matrix/MatrixI.H
View file @
e1201d73
...
...
@@ -35,8 +35,9 @@ inline void Foam::Matrix<Form, Type>::doAlloc()
{
const
label
len
=
size
();
if
(
len
)
if
(
len
>
0
)
{
// With sign-check to avoid spurious -Walloc-size-larger-than
v_
=
new
Type
[
len
];
}
}
...
...
wmake/rules/linux64Mingw/c++
View file @
e1201d73
...
...
@@ -9,7 +9,7 @@ include $(RULES)/c++$(WM_COMPILE_OPTION)
c++FLAGS = $(c++ARCH) $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS)
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS)
-Wno-alloc-size-larger-than
-c $< -o $@
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
cxxtoo = $(Ctoo)
cctoo = $(Ctoo)
cpptoo = $(Ctoo)
...
...
Write
Preview
Markdown
is supported
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