Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 395
    • Issues 395
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Wiki
  • Error messages
  • casting errors

casting errors · Changes

Page history
Create an idea for casting errors authored Mar 26, 2025 by Quinten Cabo's avatar Quinten Cabo
Show whitespace changes
Inline Side-by-side
error-messages/casting-errors.md 0 → 100644
View page @ 8a07020f
You get cast errors when you do something like this:
```c
int main() {
a0 = (char)0;
return 0;
}
```
Which gives: `Element types of the cast-type "short" and the expr-type "int{4}" should be identical; types found: short and int{4}`
Weirdly this does not give an error:
```c
int main() {
a = (int[+])0;
return 0;
}
```
Even though I don't think you should be able to cast a scaler to int[+].
Even this is fine!
```c
int main() {
a = (int[7])0;
return 0;
}
```
Clone repository
  • concepts
    • Deprecated Modules
    • Globals
    • Named Tuples
    • Overloading
    • Preprocessor
    • Primitive functions
    • Runetime Representations
    • input stdin
    • phm xt
    • ref counting methods
    • type famlies
    • type patterns
  • error messages
    • Anthropomorphic error essages
    • Colored error messages
    • Empty file error
View All Pages