Skip to content

Why do I need to include every single file #1163

Description

@lafonso-gnrc

Hello,

I have a particular case that I am trying to understand.

This project builds fine in WSL2 but not on Windows. I've tried both ceedling v1.0.0 and v1.0.1.

I effectively have the maybe questionable format as follows. Some functions from module_a.c have their prototype in module_public.h. There is a reason for that, mostly just have functions that I want to use between a sort of manager module in module.c but not by the application and I think this transmits that (I do regret it a little but...)

  • module_h
  • module.c
  • module_a.h
  • module_b.h
  • module_a.c
  • module_b.c

In module.h there is the prototypes for function module_a_set_state()

in my test_module_a.c I only included module_private_a.h and had TEST_SOURCE_FILE(module_a.c). This works under WSL2 running Ubuntu. It is questionable but okay. In windows this does not work it says module_a_set_state()`is undefined. Question 1: Why would that be the case?

To try to correct this I included module.h in the test file but now it tries to compile module.c , which no function is called, which won't work unless I include every single include used in module.c in the in the test file! Question 2: Is this as per design and this code is just not friendly for using ceedling?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions