Rust-GCC / Rust-GCC/gccrs

Fix 'main' return value

Open
#289 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
2.9k
Forks
230
Avg merge
19h 55m
Merged PRs (30d)
67

Description

As discussed in https://gcc-rust.zulipchat.com/#narrow/stream/281658-compiler-development/topic/Testsuite/near/230597886:

We're currently synthesizing a void main function (see -fdump-tree-gimple); this should (for now) probably be int main, plus the usual return 0 at the end.
(I'm aware of https://github.com/Rust-GCC/gccrs/issues/144 "Implement main shim" which probably needs to be completed to resolve this properly.)

Fixing this (so that we get deterministic normal process termination) is a prerequisite for #281 "Create runnable test folder".

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing where gccrs synthesizes the current void main function, then review issue #144 for the main-shim context. Change the generated entry point to return int with a normal zero return, and verify that this resolves the prerequisite for the runnable test folder in issue #281.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.