Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production of redundant C header files when building static library in project #1698

Open
vssukharev opened this issue Dec 18, 2024 · 2 comments
Assignees

Comments

@vssukharev
Copy link
Contributor

vssukharev commented Dec 18, 2024

Steps to reproduce:

  1. Create project.json with the following content:
{
  "output": "build",
  "targets": {
     "main": {
      "type": "static-lib",
      "sources": [ "main.c3" ],
    },
  },
}
  1. Create file main.c3 (can be empty)
  2. Run c3c build main or c3c build

Notice that this bug occurs when building targets with type static-lib and dynamic-lib. Everything is fine when target is prepare or executable

This problem is traced on compiler versions >= v0.6.4 and master also.

@lerno
Copy link
Collaborator

lerno commented Dec 22, 2024

This is correct, because the idea is to immediately make the library usable from C. Please instead file errors with the header output, which I will make sure that it works.

@lerno lerno self-assigned this Dec 22, 2024
@vssukharev
Copy link
Contributor Author

vssukharev commented Dec 22, 2024

Here is the header produced from any library sources

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#ifndef __c3__
#define __c3__

typedef void* c3typeid_t;
typedef void* c3fault_t;
typedef struct { void* ptr; size_t len; } c3slice_t;
typedef struct { void* ptr; c3typeid_t type; } c3any_t;

#endif

/* TYPES */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants