Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented rrspacing #3623

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Implemented rrspacing #3623

merged 2 commits into from
Mar 11, 2024

Conversation

parth121101
Copy link
Contributor

fixes: #3622

@parth121101 parth121101 marked this pull request as ready for review March 11, 2024 18:01
z = 3.2
w = 5.6

print *, Rrspacing(4.1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lowercase everywhere:

Suggested change
print *, Rrspacing(4.1)
print *, rrspacing(4.1)

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise ok.

@certik certik merged commit d511eff into lfortran:main Mar 11, 2024
21 checks passed
@certik
Copy link
Contributor

certik commented Mar 11, 2024

I am going to merge it, you can send a new PR with the lowercase change.

@gxyd
Copy link
Contributor

gxyd commented Mar 12, 2024

This generates a few warnings while building now after this PR:

In file included from /Users/gxyd/OpenSource/lfortran/src/lfortran/semantics/ast_symboltable_visitor.cpp:16:
In file included from /Users/gxyd/OpenSource/lfortran/src/lfortran/semantics/ast_common_visitor.h:10:
In file included from /Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_function_registry.h:4:
In file included from /Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_function_registry_util.h:4:
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3416:18: warning: variable 'fraction' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        else if (kind == 8) {
                 ^~~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3430:29: note: uninitialized use occurs here
        fraction = std::abs(fraction);
                            ^~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3416:14: note: remove the 'if' if its condition is always true
        else if (kind == 8) {
             ^~~~~~~~~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3400:24: note: initialize the variable 'fraction' to silence this warning
        double fraction;
                       ^
                        = 0.0
1 warning generated.
[ 63%] Building CXX object src/lfortran/CMakeFiles/lfortran_lib.dir/semantics/ast_body_visitor.cpp.o
In file included from /Users/gxyd/OpenSource/lfortran/src/lfortran/semantics/ast_body_visitor.cpp:16:
In file included from /Users/gxyd/OpenSource/lfortran/src/lfortran/semantics/ast_common_visitor.h:10:
In file included from /Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_function_registry.h:4:
In file included from /Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_function_registry_util.h:4:
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3416:18: warning: variable 'fraction' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        else if (kind == 8) {
                 ^~~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3430:29: note: uninitialized use occurs here
        fraction = std::abs(fraction);
                            ^~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3416:14: note: remove the 'if' if its condition is always true
        else if (kind == 8) {
             ^~~~~~~~~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3400:24: note: initialize the variable 'fraction' to silence this warning
        double fraction;
                       ^
                        = 0.0
1 warning generated.
[ 64%] Building CXX object src/lfortran/CMakeFiles/lfortran_lib.dir/semantics/ast_to_asr.cpp.o
In file included from /Users/gxyd/OpenSource/lfortran/src/lfortran/semantics/ast_to_asr.cpp:13:
In file included from /Users/gxyd/OpenSource/lfortran/src/lfortran/semantics/ast_common_visitor.h:10:
In file included from /Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_function_registry.h:4:
In file included from /Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_function_registry_util.h:4:
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3416:18: warning: variable 'fraction' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        else if (kind == 8) {
                 ^~~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3430:29: note: uninitialized use occurs here
        fraction = std::abs(fraction);
                            ^~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3416:14: note: remove the 'if' if its condition is always true
        else if (kind == 8) {
             ^~~~~~~~~~~~~~~
/Users/gxyd/OpenSource/lfortran/src/libasr/pass/intrinsic_functions.h:3400:24: note: initialize the variable 'fraction' to silence this warning
        double fraction;
                       ^
                        = 0.0

don't seem too hard to get rid of them though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement rrspacing function
3 participants