Fix cfitsio compiler warnings: unused static function and self-assignment#26
Merged
Fix cfitsio compiler warnings: unused static function and self-assignment#26
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 1at top of file to suppress the-Wunneeded-internal-declarationwarning on the flex-generatedstatic 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-assignmentwtdatatype = wtdatatype;that triggers-Wself-assign. The variable already holds a valid value from the precedingffiprs()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()
==> R CMD build Rfits
Removed empty directory ‘Rfits/src/cfitsio/utilities’
Omitted ‘LazyData’ from DESCRIPTION
==> R CMD check --as-cran Rfits_1.14.0.tar.gz
Apple clang version 14.0.0 (clang-1400.0.29.202)
GNU Fortran (GCC) 14.2.0
Maintainer: ‘Aaron Robotham aaron.robotham@uwa.edu.au’
New submission
Suggests or Enhances not in mainstream repositories:
ProFound, Rwcs
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.
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.
installed size is 5.1Mb
sub-directories of 1Mb or more:
doc 2.1Mb
libs 1.6Mb
Files ‘README.md’ or ‘NEWS.md’ cannot be checked without ‘pandoc’ being installed.
Found the following assignments to the global environment:
File ‘Rfits/R/Rfits_methods_base.R’:
assign(".current_image", x, envir = .GlobalEnv)
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.