~mcf

https://mforney.org

Trackers

~mcf/cproc

Last active 7 days ago

~mcf/x509cert

Last active 2 years ago

~mcf/dnssec-rr

Last active 3 years ago

~mcf/libtls-bearssl

Last active 4 years ago

~mcf/qbe

Last active 5 years ago

~mcf/oasis

Last active 5 years ago

~mcf/sbase

Last active 5 years ago

~mcf/samurai

Last active 5 years ago

#1 Variable-length arrays 7 days ago

Comment by ~mcf on ~mcf/cproc

Michael Forney referenced this ticket in commit 1e66f1c.

#79 Assertion failed: tq == QUALNONE (expr.c: decay: 101) 7 days ago

Comment by ~mcf on ~mcf/cproc

Michael Forney referenced this ticket in commit a4a041b.

#1 Variable-length arrays 12 days ago

Comment by ~mcf on ~mcf/cproc

Maybe this could work, but I think it should actually be pretty easy to add support for VLAs to QBE, just a matter of syntax.

In terms of implementing in cproc, I think the best order would be:

  • Add support for variably modified types, such as int (*array)[f()]. To do this, we'd add a new field struct expr *expr to the array struct in struct type, and perhaps a struct value *size field as well. The size would be computed by evaluating the expression at the appropriate time (I'd need to do some more reading of the spec). Several operators, such as sizeof, and pointer arithmetic would have to be changed to use the dynamic size instead of the constant size in the type.
  • Most uses of VLAs occur at the top-level of the function, so we should be able to support those easily with just one alloc.
  • The general case is what needs QBE support. I think stacksave/stackrestore instructions would be the best interface for frontends.

#82 Link to issue tracker on project summary page fails 17 days ago

Comment by ~mcf on ~mcf/cproc

REPORTED RESOLVED FIXED

#72 __attribute__((packed)) 21 days ago

Comment by ~mcf on ~mcf/cproc

Michael Forney referenced this ticket in commit 2e5ef23.

REPORTED RESOLVED IMPLEMENTED

#68 Stop ignoring attributes 21 days ago

Comment by ~mcf on ~mcf/cproc

Michael Forney referenced this ticket in commit 7c4217e.

REPORTED RESOLVED IMPLEMENTED

#68 Stop ignoring attributes 21 days ago

Comment by ~mcf on ~mcf/cproc

Michael Forney referenced this ticket in commit 591853a.

#68 Stop ignoring attributes 21 days ago

Comment by ~mcf on ~mcf/cproc

Michael Forney referenced this ticket in commit 731e7a2.

#76 __has_builtin() falsely indicates support for certain built-in functions 22 days ago

Comment by ~mcf on ~mcf/cproc

Yeah, this is due to the external preprocessor. I'm not sure the best way to solve it. Adding -U __has_builtin to the preprocessor flags results in

<command-line>: warning: undefining "__has_builtin"

with no apparent way of turning it off.

Similarly, -D __has_builtin(x)= results in

<command-line>: warning: "__has_builtin" redefined

Looking in the gcc source and manual, there is -Wno-builtin-macro-redefined. Unfortunately, it seems that __has_builtin is defined internally with always_warn_if_redefined, so the warning persists.

I was hoping to ignore this problem until the cproc preprocessor is finished. But maybe the warning is better than falsely claiming support for built-ins?

#80 segfault when returning before a switch statement 22 days ago

Comment by ~mcf on ~mcf/cproc

Michael Forney referenced this ticket in commit 9eda39f.