On Sat, 7 Feb 2015, Georg Icking-Konert wrote:

> hi Maarten, hi Erik,
> 
> thanks a lot by your feedback! Below I got 2 contradicting opinions: if I
> understand Erik right, there is no easy fix to this problem and I should
> just skip the declaration in the interrupt header file (like for
> Raisonance). That will do of course, but it would prohibit 100%
> compatibility with the examples and libs provided by STM on their homepage.
> So, before I go for this option: Maarten, can you confirm or reject Eriks
> statement (in contrast to first gut feeling), i.e. this won?t be supported by
> SDCC anytime soon? For your feedback thanks a lot in advance!
> 
> Georg

The problems with the ambiguity are not insurmountable. There are other 
places in the C language with ambiguity in the parsing. The most obvious 
is how "else" gets associated with "if":

   if (condition1)
     if (condition2)
       statement1;
     else
       statement2;

>From a grammar standpoint, the else could be associated with either "if 
(condition1)" or "if (condition2)". The C language specifies that it 
should be associated with "if (condition2)" and (hopefully) everyone who 
programs in C knows and expects this.

Changing the grammar to support the function attributes either before or 
after the function name and parameters, is fairly simple, but caused bison 
(the parsar generator) to see roughly 30 new shift/reduce conflicts 
(grammar ambiguities). I also tried just the interrupt attribute rather 
than all of the function attributes; this still added 2 new shift/reduce 
conflicts.

In the past SDCC has had a number of bugs related to properly handling 
function pointer types. So I am hesitant to commit a change to the grammar 
that increases the ambiguities in this area without having a really clear 
understanding of the result. This proposed change has, at least for me, 
moved beyond a quick and simple change to something that would require 
more study before I would feel comfortable. I can't speak for the other 
developer's priorities, but this would be low priority for me; I have only 
spent the time that I have on it because it initially seemed a simple and 
straightforward change.

   Erik


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to