Thread overview
[Issue 23699] compilable/test22807.c:10:10: error: unknown type name ‘OldFashionedHeader’
Feb 12, 2023
Iain Buclaw
Feb 20, 2023
Walter Bright
Feb 20, 2023
Iain Buclaw
[Issue 23699] ImportC: Unclear documentation that struct/union/enum introduce implicit typedefs in ImportC
Feb 20, 2023
Iain Buclaw
Feb 20, 2023
Iain Buclaw
Feb 27, 2023
Iain Buclaw
Apr 10, 2023
Dlang Bot
[Issue 23699] ImportC: Unclear documentation that struct/union/enum introduce implicit typedefs
Apr 10, 2023
Walter Bright
Apr 10, 2023
Dlang Bot
February 12, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, ImportC
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=23689
         Depends on|                            |23689


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=23689
[Issue 23689] ImportC: C tests in the testsuite are not valid C
--
February 20, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
ImportC deals with tag name spaces like C++ does. I.e. they are distinct only if there is both a tag name declaration and a regular name declaration both in the same scope.

It shouldn't cause any more trouble than using a C++ compiler to compile C code.

--
February 20, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to Walter Bright from comment #1)
> ImportC deals with tag name spaces like C++ does. I.e. they are distinct only if there is both a tag name declaration and a regular name declaration both in the same scope.
> 
> It shouldn't cause any more trouble than using a C++ compiler to compile C code.
There is a passing reference to this under Tag Symbols

https://dlang.org/spec/importc.html#tag-symbols

It sort of gets lost in the ether as a lot of the focus of that section points to the ImportC limitations, rather than extensions.

--
February 20, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|dmd                         |dlang.org
            Summary|compilable/test22807.c:10:1 |ImportC: Unclear
                   |0: error: unknown type name |documentation that
                   |‘OldFashionedHeader’        |struct/union/enum introduce
                   |                            |implicit typedefs in
                   |                            |ImportC

--
February 20, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
The term used by C++ is "elaborated type specifier", which is used to distinguish between types and regular identifiers.

For example, the following code is accepted by both C++ and ImportC
```
struct s { int a; };

void g(int s) {
  struct s* p = (struct s*)malloc(sizeof(struct s));
  p->a = s;
}
```

Whereas this is rejected by both C++ and ImportC, for the same reason.
```
struct s { int a; };

void g(int s) {
  s* p = (s*)malloc(sizeof(s));
  p->a = s;
}
```

--
February 27, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

--
April 10, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dlang.org pull request #3581 "fix Issue 23699 - ImportC: Unclear documentation that struct/union/en…" fixing this issue:

- fix Issue 23699 - ImportC: Unclear documentation that struct/union/enum introduce implicit typedefs

https://github.com/dlang/dlang.org/pull/3581

--
April 10, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ImportC: Unclear            |ImportC: Unclear
                   |documentation that          |documentation that
                   |struct/union/enum introduce |struct/union/enum introduce
                   |implicit typedefs in        |implicit typedefs
                   |ImportC                     |

--
April 10, 2023
https://issues.dlang.org/show_bug.cgi?id=23699

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dlang.org pull request #3581 "fix Issue 23699 - ImportC: Unclear documentation that struct/union/en…" was merged into master:

- 5cbb87c50a592154f72f8cf71446b76ad057f1a8 by Walter Bright:
  fix Issue 23699 - ImportC: Unclear documentation that struct/union/enum
introduce implicit typedefs

https://github.com/dlang/dlang.org/pull/3581

--
December 15, 2023
https://issues.dlang.org/show_bug.cgi?id=23699
Issue 23699 depends on issue 23689, which changed state.

Issue 23689 Summary: ImportC: C tests in the testsuite are not valid C https://issues.dlang.org/show_bug.cgi?id=23689

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--