Skip to content

When comment is not enough #63

Open
@kiselgra

Description

@kiselgra

I want to write this code:

inline __attribute((always_inline)) int foo() { return 0; }

However, neither of the following two work. The former because the function-call gets messed up (which, I think, is ok), the latter because of c-compatible renaming (which, I think, we want to have in the general case).

(function foo () -> (inline __attribute__((always_inline)) int)
  (return 0))

(function foo () -> (inline |__ATTRIBUTE__((ALWAYS_INLINE))| int)
  (return 0))

The result is as follows

inline __attribute__ 
always_inline()(); int foo(void)
{
        return 0;
}

inline __attribute____always_inline__ int foo(void)
{
        return 0;
}

As usual with unusual cases, comment comes in handy:

(function foo () -> (inline (comment "__attribute__((always_inline))" :prefix "") int)
  (return 0))

But starts a new line:

inline 
__attribute__((always_inline)) int foo(void)
{
        return 0;
}

@lispbub Maybe we can just add an option to comment to not trigger a newline?

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions