Repository navigation
[Linting Rule] Compiled Code
Generated from 'wiki-linter.ts' on 2026-10-25, 09:29:25 UTC (v2.16.6), do not edit directly.
Compiled Code [overview]
This rule ports the following steps of R CMD check (see the conformance table for the legend):
This rule is a best-effort rule.
Finds problems in src/ and the build files: non-portable Makevars flags, BLAS/LAPACK and OpenMP flag use, GNU make extensions, pragmas, line endings, Fortran KIND, the C++ standard, calls to non-API or non-portable entry points, and useDynLib against src/.
This linting rule is implemented in src/linter/rules/cmd-check/compiled-code.ts.
Linting rules can be configured by passing a configuration object to the linter query as shown in the example below.
The compiled-code rule accepts the following configuration options:
-
allowedFlags
flags (with the dash) that are fine even though they matchnonPortableFlags
R CMD check #65, #78 -
checkNonApi
also look for calls of the non-API entry points of R (defaulttrue)
R CMD check #76 -
checkRegistration
also look for the missing registration of native routines (defaulttrue)
R CMD check #76 -
extraNonApiEntryPoints
further non-API entry points to flag besides the onesRlists
R CMD check #76 -
flagStarKinds
also flag Fortran type declarations likereal*8, which are no standard Fortran (defaulttrue)
R CMD check #74 -
headerPackages
the header (a file name, or a directory prefix ending in/) to the package that has to be inLinkingTofor it
R CMD check #77 -
knownCxxStandards
the C++ standardsRstill honors; others requested throughCXX_STDare unknown
R CMD check #75 -
nonPortableFlags
regular expressions (anchored by flowR, without the leading dash) for the compiler flagsR CMD checkcalls non-portable
R CMD check #65, #78 -
obsoleteCxxStandards
the C++ standardsRignores as obsolete
R CMD check #75 -
skip
checks (by theirR CMD checktitle) to skip -
unportableCalls
the functions compiled code must not call because they might terminate R, write to stdout, use system RNGs or[v]sprintf
R CMD check #76 -
unportableFortran
the Fortran statements compiled code must not use (I/O,stop, system RNGs)
R CMD check #76 -
unportableObjects
the objects (and C++ streams) compiled code must not use for the same reason
R CMD check #76
A project with the code R/code.R:
f <- function(x) .Call("C_f", x)and the files
DESCRIPTION:
Package: pkg
Version: 1.0
Title: A Package
License: MIT
NAMESPACE:
useDynLib(pkg)
export(f)
src/Makevars:
PKG_CXXFLAGS = -O3 -Wall -fPIC
The linting query can be used to run this rule on the above example:
[ { "type": "linter", "rules": [ { "name": "compiled-code", "config": {} } ] } ]Results (prettified and summarized):
Query: linter (3 ms)
╰ Compiled Code (compiled-code):
╰ certain:
╰ Non-portable flags in variable 'PKG_CXXFLAGS': -O3 -Wall -fPIC at /pkg/src/Makevars:1.1
╰ PKG_CXXFLAGS set in 'src/Makevars' without any corresponding files at /pkg/src/Makevars:1.1
More examples are the test cases in test/functionality/linter/cmd-check/lint-compiled-code.test.ts.
Currently maintained by Florian Sihler and Oliver Gerstl at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Testing & Linting (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information