scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 0825b37476468ac55cc493b0645fed0f37dbc756
parent b35216888064e8e719e5ad4facc54ca26386afde
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 11 Dec 2016 12:49:20 +0100

Fix some errors in README

There a few problems in README about volatile and const. They are fixed
now although we should change the text to show that we want to implement
volatile in the future.

Diffstat:
MREADME | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/README b/README @@ -10,8 +10,8 @@ it will have some differences: Type qualifers make the type system ugly, and their uselessness add unnecessary complexity to the compiler (and increased compilation time): - const: The definition of const is not clear in the standard. - If a const value is modified the behaviour is implementation - defined. It seems it was defined in order to be able to + If a const value is modified the behaviour is undefined + behaviour. It seems it was defined in order to be able to allocate variables in ROM rather than error detection. This implememtation will not warn about these modifications and the compiler will treat them like normal variables (the standard @@ -22,13 +22,13 @@ unnecessary complexity to the compiler (and increased compilation time): volatile have undefined state) and for memory mapped registers or variables whose values are modified asynchronously. This can be achieved with special pragma values though. - In the first case, this is non-portable code by definition + In the first case, it generates a lot of problems with modern + processors and multithreading, where not holding the value in a + register is not good enough (an explicit memory barrier is needed). + In the second case, this is non-portable code by definition (depending on the register mapped), so it is better to deal with it using another solution (compiler extensions or direct assembler). - In the second case, it generates a lot of problems with modern - processors and multithreading, where not holding the value in a - register is not good enough (an explicit memory barrier is needed). - restrict: This qualifer can only be applied to pointers to mark that the pointed object has no other alias. This qualifer