• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stedolan / jq
84%
master: 84%

Build:
Build:
LAST BUILD BRANCH: doc-repeat
DEFAULT BRANCH: master
Repo Added 07 Aug 2015 07:09AM UTC
Files 288
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH math-check-fix-build-test
branch: math-check-fix-build-test
CHANGE BRANCH
x
Reset
  • math-check-fix-build-test
  • 1.6rc2
  • bugfix/aix-issues-jq1.6
  • dec_literal_number
  • dependabot/pip/docs/jinja2-2.11.3
  • dependabot/pip/docs/lxml-4.6.2
  • dependabot/pip/docs/lxml-4.6.3
  • dependabot/pip/docs/pyyaml-5.4
  • dlopen
  • fix-destructuring-alternation
  • fix-travis-osx
  • jq-1.5-branch
  • jq-1.6
  • jq-1.6rc1
  • macos-strptime
  • master
  • no-more-ruby
  • qsort-stability

pending completion
445

Pull #3

travis-ci

wtlangford
Bugfix: Math function checking

We had config machinery that determined which math functions are
available in libc. If a c math function was missing on the host system,
then the corresponding jq function would be removed from the source,
enabling the build to proceed anyway. The detection machinery was broken
in a subtle way, as was shown after glibc updated to 2.27, dropping the
`pow10` function. This caused compilation to fail.

The essential problem was that we detected whether a math function was
available by compiling and linking a small program evaluating that
function on constants. However, since gcc's optimization machinery has
special knowledge of some math functions (e.g. `pow10`), it can
optimize them away, even if they don't exist in the library and are not
linkable. That is, the following example compiles and links against
glibc 2.27, even though `pow10` has been removed:
```
int main () {
  printf("%f", pow10(0.5));
  return 0;
}
```

What?!
On the other hand, this program does not link:
```

int main () {
  double f;
  printf("%f", &f);
  printf("%f", pow10(f));
  return 0;
}
```

In the first program the call to `pow10` can be optimized away as a
constant expression. This requires GCC to know about `pow10` (which it
does!), but it does not require `pow10` to be in the library (and
actually linkable).

The solution is to use autoconf's machinery for detecting function
presence, instead of our own (buggy) machinery. This has the added
benefit of simplifying the code.

The bug was reported in issue #1659
Pull Request #3:

5153 of 6104 relevant lines covered (84.42%)

6923128.96 hits per line

Relevant lines Covered
Build:
Build:
6104 RELEVANT LINES 5153 COVERED LINES
6923128.96 HITS PER LINE
Source Files on math-check-fix-build-test
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
445 math-check-fix-build-test Bugfix: Math function checking We had config machinery that determined which math functions are available in libc. If a c math function was missing on the host system, then the corresponding jq function would be removed from the source, enabling ... Pull #3 16 Nov 2020 04:02PM UTC wtlangford travis-ci pending completion  
See All Builds (768)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc