Skip to content

bc: minarg checks for builtin functions #865

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

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Dec 6, 2024

  • When previously expanding the number of builtin functions, I didn't notice that bi_sqrt() would incorrectly call sqrt(undef) if I type sqrt() at bc prompt
  • Other versions of bc raise an error for this, and it's a good idea to flag bad function usage
  • This patch adds min-args check to all the builtin functions; all take a single arg except j() which takes two
  • When I pass too many args to c() I already see an error

* When previously expanding the number of builtin functions, I didn't notice that bi_sqrt() would incorrectly call sqrt(undef) if I type sqrt() at bc prompt
* Other versions of bc raise an error for this, and it's a good idea to flag bad function usage
* This patch adds min-args check to all the builtin functions; all take a single arg except j() which takes two
* When I pass too many args to c() I already see an error
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: bc The bc program labels Dec 6, 2024
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:46 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing December 6, 2024 04:47 — with GitHub Actions Inactive
@coveralls
Copy link

coveralls commented Dec 6, 2024

Pull Request Test Coverage Report for Build 12193115367

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 72.464%

Totals Coverage Status
Change from base Build 12185242343: 0.0%
Covered Lines: 350
Relevant Lines: 483

💛 - Coveralls

@briandfoy briandfoy self-assigned this Dec 6, 2024
@briandfoy briandfoy merged commit d4775df into briandfoy:master Dec 6, 2024
23 checks passed
@briandfoy
Copy link
Owner

changes: catch situations where there are missing arguments to functions

@briandfoy briandfoy added Status: accepted The fix is accepted Type: bug an existing feature does not work Status: released there is a new release with this fix and removed Priority: low get to this whenever Type: enhancement improve a feature that already exists Status: accepted The fix is accepted labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: bc The bc program Status: released there is a new release with this fix Type: bug an existing feature does not work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants