Tests for checking type requirements for bounds declarations.#48
Merged
dtarditi merged 4 commits intocheckedc:masterfrom Aug 31, 2016
Merged
Tests for checking type requirements for bounds declarations.#48dtarditi merged 4 commits intocheckedc:masterfrom
dtarditi merged 4 commits intocheckedc:masterfrom
Conversation
commit c027760a1b6aae03ee5a004b84940ebf88a78238
Author: David Tarditi <dtarditi@microsoft.com>
Date: Mon Aug 29 17:35:42 2016 -0700
Test typechecking bounds declarations for locals, globals, and members.
commit f284a76d6e7cc16e7108cf780da0734aac1733b5
Author: David Tarditi <dtarditi@microsoft.com>
Date: Sat Aug 27 13:41:46 2016 -0700
Fix typos uncovered by typechecking bounds declarations.
commit 599a8d273bc457ee861c28e7b6b9836725b84424
Merge: 97fa48f 930c9c2
Author: David Tarditi <dtarditi@microsoft.com>
Date: Sat Aug 27 13:15:42 2016 -0700
Merge branch 'master' of https://github.com/Microsoft/checkedc
commit 97fa48fc173d10604b66707966a8209c2e783768
Author: David Tarditi <dtarditi@microsoft.com>
Date: Thu Aug 25 10:57:03 2016 -0700
Update typechecking wording for count and byte_count.
- Add comment describing the organization of tests. - Add some missing cases for local variables, global variables, and member bounds declarations. - Add tests for return bounds declarations. - Make the tests structurally equivalent for bounds declarations checks. Use different prefixes for names to disambiguate them, but use the same numbering scheme for all the different cases.
- Change a 'must' to 'can' because there are additional types of variables that can have bounds declarations. These are described later in the document. - Loosen the requirements for bounds(e1, e2): allow e1 and e2 to be pointers to the same type of object.
| to be different is useful for describing the results of pointer casts and | ||
| \var{e2} must be pointers to the same type. Typically \var{x} is also | ||
| a pointer to that type or an array of that type. | ||
| However, \var{x} can point to or be an array of a different type. |
Collaborator
There was a problem hiding this comment.
Maybe \var{x} can be a pointer to or an array of?
|
Looks reasonable to me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a pull request for the checked-clang repo (checkedc/checkedc-clang#42) that adds checking of type requirements for bounds declarations to clang. See the pull request for details.
This commit adds the matching tests. It includes both positive tests (that are supposed to work) and negative tests that should fail with an error message. We have added the expected error message from the clang implementation for the negative tests, so that the tests can be used in the clang test infrastructure. This commit also fixes issues in existing tests that the checking uncovered.