Skip to content

Access to memory mapped registers is Undefined Behavior according to the C standard. #1

Closed

Description

@ZiCog

Given that this code makes no use of "volatile" when reading and writing from mapped memory it's behavior is undefined as per the C standard.

As such it is only a matter of luck that it works at all!

Activity

  1. jojopi commented on Oct 29, 2020

    @jojopi

    I do not follow ZiCog's logic at all. The C standard makes no mention of mmap, or memory mapped registers, and the POSIX standard which defines mmap does not talk about volatile in this context.

    Behavior is undefined when the standard states so, or when the code violates a "shall" constraint in the standard. I do not see that here.

  2. locked and limited conversation to collaborators on Dec 30, 2021
  3. converted this issue into a discussion #4 on Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions