Skip to content

[AArch64] no-FP ABI check blames caller's declaration #102983

Closed
@jroelofs

Description

@jroelofs
$ cat >vaargs.c <<EOF
#include <stdarg.h>
#include <stdbool.h>

double takes_double(double);

static bool takes_va_list_ptr(va_list * ap) {
  double val = va_arg(*ap, double);
  return takes_double(val);
}

int main() {
  va_list ap;
  takes_va_list_ptr(&ap);
}
EOF
$ ./bin/clang vaargs.c -c -o /dev/null -march=armv8-a+nofp --target=arm64-apple-ios
vaargs.c:6:13: error: 'takes_va_list_ptr' requires 'double' type support, but ABI 'darwinpcs' does not support it
    6 | static bool takes_va_list_ptr(va_list * ap) {
      |             ^
vaargs.c:6:13: error: 'takes_va_list_ptr' requires 'double' type support, but ABI 'darwinpcs' does not support it
2 errors generated.

It would be less confusing if the diagnostic pointed at the call site for takes_double, with a note pointing at takes_double's declaration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ABIApplication Binary Interfacebackend:AArch64clang:codegenIR generation bugs: mangling, exceptions, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions