Raphael,
I think you are right and that this is a bug.
Maarten
> Hi,
>
> > void delay (uint32_t delay)
> > {
> > setCounter (delay) ;
> > while (!counterTriggered ())
> > ;
> > }
> >
> > Gives the error:
> >
> > dross.c:435: error 98: conflict with previous definition of 'delay'
> > for attribute 'type'
> > from type 'unsigned-long-int'
> > to type 'void function ( unsigned-long-int) '
> >
> > However it compiles (and works) with GCC (AVR)
> >
> > I can see why it's giving that error, but I'm not sure which is right
> > though... I imagine there's something deep in a standard somewhere that
> > says something like: Implementation dependant... :-)
>
> From Committee Draft N1124 on C, Section 6.2.1:
>
> 4 Every other identifier has scope determined by the placement of its
> * declaration (in a declarator or type specifier). If the declarator
> * or type specifier that declares the identifier appears outside of
> * any block or list of parameters, the identifier has file scope, which
> * terminates at the end of the translation unit. If the declarator or
> # type specifier that declares the identifier appears inside a block or
> # within the list of parameter declarations in a function definition,
> # the identifier has block scope, which terminates at the end of the
> # associated block. If the declarator or type specifier that declares
> the identifier appears within the list of parameter declarations in
> a function prototype (not part of a function definition), the
> identifier has function prototype scope, which terminates at the end
> of the function declarator. If an identifier designates two different
> entities in the same name space, the scopes might overlap. If so, the
> scope of one entity (the inner scope) will be a strict subset of the
> scope of the other entity (the outer scope). Within the inner scope,
> the identifier designates the entity declared in the inner scope;
> the entity declared in the outer scope is hidden (and not visible)
> within the inner scope.
>
> I gather that the identifier 'delay' for the function has file scope (*)
> and should be hidden by the parameter 'delay', which has block scope (#),
> so this appears to be a bug in SDCC and should compile nicely.
>
> What do the other developers think?
>
>
> Raphael
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Sdcc-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user