Skip to content

Fix cfitsio compiler warnings: unused static function and self-assignment#26

Merged
asgr merged 3 commits intomasterfrom
copilot/fix-new-warnings-cfitsio
Feb 23, 2026
Merged

Fix cfitsio compiler warnings: unused static function and self-assignment#26
asgr merged 3 commits intomasterfrom
copilot/fix-new-warnings-cfitsio

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Two compiler warnings introduced with newer cfitsio/clang emit as significant warnings during R CMD check --as-cran.

Changes

  • src/cfitsio/eval_l.c — Add #define YY_NO_INPUT 1 at top of file to suppress the -Wunneeded-internal-declaration warning on the flex-generated static int input(yyscan_t). This is the standard flex mechanism; the function and its forward declaration are both guarded by #ifndef YY_NO_INPUT.

  • src/cfitsio/histo.c:807 — Remove no-op self-assignment wtdatatype = wtdatatype; that triggers -Wself-assign. The variable already holds a valid value from the preceding ffiprs() call.

Original prompt

This section details on the original issue you should resolve

<issue_title>Seeing some new warnings with new CFITSIO</issue_title>
<issue_description>Some new "warnings" we might want to tackle. Builds fine and passes checks though.

==> Rcpp::compileAttributes()

  • Updated R/RcppExports.R

==> R CMD build Rfits

  • checking for file ‘Rfits/DESCRIPTION’ ... OK
  • preparing ‘Rfits’:
  • checking DESCRIPTION meta-information ... OK
  • cleaning src
  • running ‘cleanup’
  • installing the package to build vignettes
  • creating vignettes ... OK
  • cleaning src
  • running ‘cleanup’
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
    Removed empty directory ‘Rfits/src/cfitsio/utilities’
    Omitted ‘LazyData’ from DESCRIPTION
  • building ‘Rfits_1.14.0.tar.gz’

==> R CMD check --as-cran Rfits_1.14.0.tar.gz

  • using log directory ‘/Users/aaron/Rprojects/Rfits.Rcheck’
  • using R version 4.5.1 (2025-06-13)
  • using platform: x86_64-apple-darwin20
  • R was compiled by
    Apple clang version 14.0.0 (clang-1400.0.29.202)
    GNU Fortran (GCC) 14.2.0
  • running under: macOS Sequoia 15.6.1
  • using session charset: UTF-8
  • using option ‘--as-cran’
  • checking for file ‘Rfits/DESCRIPTION’ ... OK
  • checking extension type ... Package
  • this is package ‘Rfits’ version ‘1.14.0’
  • package encoding: UTF-8
  • checking CRAN incoming feasibility ... [4s/20s] NOTE
    Maintainer: ‘Aaron Robotham aaron.robotham@uwa.edu.au

New submission

Suggests or Enhances not in mainstream repositories:
ProFound, Rwcs

  • checking package namespace information ... OK
  • checking package dependencies ... OK
  • checking if this is a source package ... OK
  • checking if there is a namespace ... OK
  • checking for executable files ... OK
  • checking for hidden files and directories ... OK
  • checking for portable file names ... WARNING
    Found the following file with a non-portable file name:
    vignettes/rsconnect/documents/Rfits_methods.Rmd/rpubs.com/rpubs/Publish Document.dcf
    These are not fully portable file names.
    See section ‘Package structure’ in the ‘Writing R Extensions’ manual.
  • checking for sufficient/correct file permissions ... OK
  • checking serialization versions ... OK
  • checking whether package ‘Rfits’ can be installed ... [63s/65s] WARNING
    Found the following significant warnings:
    eval_l.c:2077:16: warning: function 'input' is not needed and will not be emitted [-Wunneeded-internal-declaration]
    histo.c:807:18: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign]
    See ‘/Users/aaron/Rprojects/Rfits.Rcheck/00install.out’ for details.
  • used C++ compiler: ‘Apple clang version 17.0.0 (clang-1700.3.19.1)’
  • used SDK: ‘’
  • checking installed package size ... INFO
    installed size is 5.1Mb
    sub-directories of 1Mb or more:
    doc 2.1Mb
    libs 1.6Mb
  • checking package directory ... OK
  • checking for future file timestamps ... OK
  • checking ‘build’ directory ... OK
  • checking DESCRIPTION meta-information ... OK
  • checking top-level files ... NOTE
    Files ‘README.md’ or ‘NEWS.md’ cannot be checked without ‘pandoc’ being installed.
  • checking for left-over files ... OK
  • checking index information ... OK
  • checking package subdirectories ... OK
  • checking code files for non-ASCII characters ... OK
  • checking R files for syntax errors ... OK
  • checking whether the package can be loaded ... OK
  • checking whether the package can be loaded with stated dependencies ... OK
  • checking whether the package can be unloaded cleanly ... OK
  • checking whether the namespace can be loaded with stated dependencies ... OK
  • checking whether the namespace can be unloaded cleanly ... OK
  • checking whether startup messages can be suppressed ... OK
  • checking use of S3 registration ... OK
  • checking dependencies in R code ... OK
  • checking S3 generic/method consistency ... OK
  • checking replacement functions ... OK
  • checking foreign function calls ... OK
  • checking R code for possible problems ... [16s/16s] NOTE
    Found the following assignments to the global environment:
    File ‘Rfits/R/Rfits_methods_base.R’:
    assign(".current_image", x, envir = .GlobalEnv)
  • checking Rd files ... NOTE
    checkRd: (-1) Rfits_all.Rd:62: Lost braces
    62 | Character vector; optional unique strings to zap out of the header. These elements are passed through code{\link{grep}} one at a time and all matches are removed. This is useful if there a problematic keywords you want to remove when passing raw headers into \code{Rwcs} functions. Be careful that the strings specified are quite unique and do not remove more of the header than intended, e.g. 'CRVAL' would remove all mentions of CRVAL1/2/3 etc. Useful tricks- for inclusive ranges you can use '[]', e.g. 'CD[1-2]_[1-2]' will match to CD1_1, CD1_2, CD2_1, CD2_2. See \code{\link{grep}} for more information on how you pattern match within strings. By default the full 80 character header per key is scanned for matches, but this can be changed with \o...

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 23, 2026 08:37
Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix new warnings with new CFITSIO Fix cfitsio compiler warnings: unused static function and self-assignment Feb 23, 2026
Copilot AI requested a review from asgr February 23, 2026 08:38
@asgr asgr marked this pull request as ready for review February 23, 2026 09:04
Copy link
Owner

@asgr asgr left a comment

Choose a reason for hiding this comment

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

Looks legit and passes checks!

@asgr asgr merged commit a56ddac into master Feb 23, 2026
10 checks passed
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.

Seeing some new warnings with new CFITSIO

2 participants