[chbot] C question: variables in GCC

Charles Manning cdhmanning at gmail.com
Thu Jun 1 23:07:25 BST 2023


Even if it is declared volatile it still gets initialised.


On Fri, Jun 2, 2023 at 10:03 AM Volker Kuhlmann <list57 at top.geek.nz> wrote:

> > I am pretty sure that C99 normally only supports initialized
> > variables (with associated value) and uninitialized variables (which
> > are set to 0).
> > Is it possible to declare storage in C that isn’t touched by the
> > associated startup code ?
>
> What happens when declaring a global uninitialised variable volatile?
> The point of volatile is that the location is accessed exactly when you
> say so.
>
> Volker
>
> --
> Volker Kuhlmann
> http://volker.top.geek.nz/      Please do not CC list postings to me.
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20230602/65b4f480/attachment-0001.html>


More information about the Chchrobotics mailing list