Jump to page: 1 2
Thread overview
[Issue 23697] compilable/test22705.c:4:1: error: unknown type name ‘Ta’
Feb 12, 2023
Iain Buclaw
Feb 12, 2023
Iain Buclaw
Feb 20, 2023
Walter Bright
Feb 20, 2023
Iain Buclaw
[Issue 23697] ImportC: No examples of invalid forward references in C code accepted by ImportC
Feb 20, 2023
Iain Buclaw
Feb 20, 2023
Iain Buclaw
Feb 20, 2023
Iain Buclaw
Feb 20, 2023
Iain Buclaw
Feb 20, 2023
Iain Buclaw
Feb 27, 2023
Iain Buclaw
[Issue 23697] No examples of invalid forward references in C code accepted by ImportC
Jun 01, 2023
Walter Bright
Jun 01, 2023
Dlang Bot
Jun 01, 2023
Dlang Bot
February 12, 2023
https://issues.dlang.org/show_bug.cgi?id=23697

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, ImportC
                 CC|                            |ibuclaw@gdcproject.org
           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 12, 2023
https://issues.dlang.org/show_bug.cgi?id=23697

Iain Buclaw <ibuclaw@gdcproject.org> changed:

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

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

Walter Bright <bugzilla@digitalmars.com> changed:

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

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
ImportC, as an extension, allows forward referencing. As it relies on D for the semantic analysis, this is natural. It doesn't cause any harm, though.

I recommend gcc just ignore this test.

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

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, as an extension, allows forward referencing. As it relies on D for the semantic analysis, this is natural. It doesn't cause any harm, though.
> 
> I recommend gcc just ignore this test.
The point is just to identify where we're deviating from standard C.  Because if we're not testing ImportC against actual C code, how can we call it a C compiler?

I think having an example of such forward reference on the documentation page would be enough to satisfy this isssue:

https://dlang.org/spec/importc.html#forward-references

Just give friendly names to the first example in this issue.
```
Ta *pa;
struct Sa { int x; };
typedef struct Sa Ta;
```

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

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|dmd                         |dlang.org
            Summary|compilable/test22705.c:4:1: |ImportC: No examples of
                   |error: unknown type name    |invalid forward references
                   |‘Ta’                        |in C code accepted by
                   |                            |ImportC

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

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
*** Issue 23720 has been marked as a duplicate of this issue. ***

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

--- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Another example of forward reference code that is accepted by ImportC, rejected by standard C.

```
struct S s;
int* p = &s.t.x;
struct S { int a; struct T t; };
```

Giving both as examples on the ImportC documentation page would be good enough.

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

--- Comment #5 from Iain Buclaw <ibuclaw@gdcproject.org> ---
*** Issue 23721 has been marked as a duplicate of this issue. ***

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

--- Comment #6 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Missing definition of `T` in second example:
```
struct S s;
int* p = &s.t.x;
struct S { int a; struct T t; };
struct T { int b; int x; };
```

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

Iain Buclaw <ibuclaw@gdcproject.org> changed:

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

--
« First   ‹ Prev
1 2