Skip to content

Compiling with warning maybe-uninitialized show a potential bug in gamma functionsΒ #898

Open
@cyrilgandon

Description

@cyrilgandon

Description

In

${t2}$ :: res, p_lim, a, b, g, c, d, y, ss
the value ss is declared:

and then use here:

The ss variable is never initalized, and generates 2 warnings with

fpm build --verbose --flag '-Wmaybe-uninitialized'

..\src\temp\stdlib_specialfunctions_gamma.f90:1424:24:

1424 | m = nint(ss)
| ^
Warning: 'ss' may be used uninitialized [-Wmaybe-uninitialized]
..\src\temp\stdlib_specialfunctions_gamma.f90:1331:52:

1331 | real(qp) :: res, p_lim, a, b, g, c, d, y, ss
| ^
note: 'ss' was declared here
..\src\temp\stdlib_specialfunctions_gamma.f90:1290:24:

1290 | m = nint(ss)
| ^
Warning: 'ss' may be used uninitialized [-Wmaybe-uninitialized]
..\src\temp\stdlib_specialfunctions_gamma.f90:1197:52:

1197 | real(dp) :: res, p_lim, a, b, g, c, d, y, ss
| ^
note: 'ss' was declared here
[ 12%] stdlib_specialfunctions_gamma. done.

Expected Behaviour

Either the value to be initialized, of the chunk of code deleted.

Version of stdlib

68524b3

Platform and Architecture

Windows

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions