Rust-GCC / Rust-GCC/gccrs

'()' should be DW_TAG_unspecified_type

Open
#1,741 1 comment 0 reactions 1 assignee View on GitHub

@philberty is already working on this.

Since Sep 15, 2026.

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

Description

I tried this code:

fn main() {
    let x = ();
}

I compiled with -g and examined the output with readelf -wi. I see this:

 <1><5e>: Abbrev Number: 4 (DW_TAG_typedef)
    <5f>   DW_AT_name        : ()
    <62>   DW_AT_decl_file   : 2
    <63>   DW_AT_decl_line   : 0
    <64>   DW_AT_type        : <0x6d>
...
 <1><6d>: Abbrev Number: 6 (DW_TAG_structure_type)
    <6e>   DW_AT_byte_size   : 0

In addition to the typedef issue (see #1740), I think it would be better for () to use DW_TAG_unspecified_type. This is what rustc does now (it used to use a 0-width integer type).

Meta

git gccrs, commit 2f9f77f9dd6330fe60554400133d7217f78afa43

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.