FriendUP HQ

Please visit the main source of project information on the FriendUP website:

C99 inline

This topic contains 2 replies, has 3 voices, and was last updated by  sokken 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #845

    Grim
    Participant

    Judging from the makefiles the FrindUP C code is supposed to follow the C99 standard. But the usage of the inline keyword does not. If a function is declared as simply “inline”, then it must also have an external definition. Right now it just happens to work (with the right versions of the right compilers and the right compiler flags), but could as well result in undefined reference errors. To follow the standard and get the intended result “inline” should be replaced with “static inline” (or just “static” will probably yield as good a result). This is what the standard says:

    “If all of the file scope declarations for a function in a translation unit include the inline function specifier without extern, then the definition in that translation unit is an inline definition. An inline definition does not provide an external definition for the function, and does not forbid an external definition in another translation unit. An inline definition provides an alternative to an external definition, which a translator may use to implement any call to the function in the same translation unit. It is unspecified whether a call to the function uses the inline definition or the external definition.”

    #861

    stefkos
    Participant

    Thx for pointing that. We will “clean” sources.

    • This reply was modified 1 year, 2 months ago by  stefkos.
    #865

    sokken
    Participant

    We will “clean” sources.

    clean

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.