Skip to content

Conversation

hkershaw-brown
Copy link
Member

Description:

Add int to main for gregorian_time.c program for compilers that enforce ISO C99

Fixes issue

Fixes #961

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Please describe any tests you ran to verify your changes.
Compiled, ran, checked the return code from a fail and and a success

> icx gregorian_time.c 
> ./a.out 123456 40
123456    40 == 1939/01/06 00:00:40
> echo $?
0
> ./a.out -123456 0 
error: days must be non-negative
> echo $?
254

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a C compilation issue by adding the missing int return type to the main function in gregorian_time.c. This change ensures compliance with ISO C99 standards, as some compilers enforce explicit return type declarations for all functions, including main.

  • Added int return type to the main function declaration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@mjs2369 mjs2369 left a comment

Choose a reason for hiding this comment

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

Ready to merge

@hkershaw-brown hkershaw-brown added the release! bundle with next release label Sep 17, 2025
@hkershaw-brown hkershaw-brown merged commit 57ba210 into main Sep 17, 2025
4 checks passed
@hkershaw-brown hkershaw-brown deleted the fix-greg-time-util branch September 17, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release! bundle with next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: gregorian_time.c fails to compile

2 participants