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

Warn on possible mistake in Awk script and Generated C code. #3

Open
noyesno opened this issue Dec 21, 2020 · 0 comments
Open

Warn on possible mistake in Awk script and Generated C code. #3

noyesno opened this issue Dec 21, 2020 · 0 comments

Comments

@noyesno
Copy link
Owner

noyesno commented Dec 21, 2020

make test is running clean on FreeBSD now, except for one warning in generated code:

cmp ./backgsub.ok _backgsub && rm -f _backgsub
x.c:269:5: warning: expression result unused [-Wunused-value]
    !strcmp(awka_gets(awka_doln(nf_tight_awk->dval, 0)), "N/A");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
cmp ./tweakfld.ok _tweakfld && rm -f _tweakfld

It's due to testcase "tweakfld.awk" has below code. Should consider update the testcase.

The -Wunused-value compiler option is useful. Will consider added as default in awka.

# set TIGHT/LOOSE to N/A if it is not one of the two allowed values
function tight_na() {
    if( $nf_tight !~ /TIGHT|LOOSE/ ) {
        $nf_tight == "N/A"  ;# -- Result NOT Used Here
    }
}

Originally posted by @noyesno in #2 (comment)

jlp765 pushed a commit to jlp765/awka that referenced this issue Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant