Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typedef error messages desugar incorrectly #254

Closed
lenary opened this issue Apr 6, 2017 · 1 comment
Closed

typedef error messages desugar incorrectly #254

lenary opened this issue Apr 6, 2017 · 1 comment
Labels
bug This labels issues that are bugs.

Comments

@lenary
Copy link
Collaborator

lenary commented Apr 6, 2017

If you have a typedef used in a written type, which desugars to a ptr<T> or array_ptr<T> type, when the error printer desugars the typedef type, it prints it as T *, which can be confusing.

Here is a not-very-confusing example:

/Users/ashe2/Code/checkedc-llvm-test-suite/MultiSource/Benchmarks/Olden/em3d/make_graph.c:357:19: error: assigning to
      '_Array_ptr<_Ptr<node_t>>' (aka 'struct node_t **') from incompatible type 'table_arr_t'
      (aka 'struct table_arr_t')

However, I've seen examples where I've tried assigning into a ptr<T> from a T * and you get an error message that says error: assigning to '_Array_ptr<Node>' (aka 'struct node_t *') from incompatible type 'Node *' (aka 'struct node_t **') which is a lot more confusing.

@dtarditi dtarditi added the bug This labels issues that are bugs. label May 31, 2017
dtarditi added a commit to dtarditi/checkedc-clang that referenced this issue Sep 30, 2017
Checked pointer types were being displayed as unchecked pointer types
in "aka" clauses for types named by typedefs that are printed in
diagnostics.  The "aka" clause displays the underlying type that was
typedef'ed.

The fix is a one-line change in to pass the pointer type kind through
in the Desugar routine in ASTDiagnostics.  This change addresses issue microsoft#254.

Testing:
- Add regression test  that checks that checked types display
  properly in "aka" clauses.
dtarditi added a commit that referenced this issue Sep 30, 2017
…cs. (#390)

Checked pointer types were being displayed as unchecked pointer types
in "aka" clauses for types named by typedefs that are printed in
diagnostics.  The "aka" clause displays the underlying type that was
typedef'ed.

The fix is a one-line change in to pass the pointer type kind through
in the Desugar routine in ASTDiagnostics.  This change addresses issue #254.

Testing:
- Add regression test  that checks that checked types display
  properly in "aka" clauses.
@dtarditi
Copy link
Contributor

This is fixed.

dopelsunce pushed a commit to dopelsunce/checkedc-clang that referenced this issue Sep 28, 2020
This change improves the formatting of code examples in the Checked C specification.  We now use the LaTeX listings package for source code examples and snippets of source code.  This should make the source code easier to read.  We use a similar color scheme to the one used by Visual Studio for C: blue for keywords, light blue for variables, and black for symbolic characters.

The listings package can import examples from source files.   This will let us move larger examples to separate source code files and make sure they compile during automated testing.
mgrang pushed a commit that referenced this issue Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This labels issues that are bugs.
Projects
None yet
Development

No branches or pull requests

2 participants