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

Add a newline at the end of test files #13685

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Commits on Sep 23, 2024

  1. Add a newline at the end of test files

    When running in some settings, a C compiler may demand newlines at the
    end of each file.  Instead of modifying everywhere that writes out test
    files to incorporate newlines in each indivudual string, simply add a
    newline when writing it out.
    
    Only add a newline to the end of the file if there isn't one already
    there.
    
    An examples of when this is a problem is running with `CC=clang` and
    `CFLAGS="--std=c99 -pedantic-errors"` and meson.build contains (for
    example) the following:
    
    ```
    project('myproject', 'c')
    executable('myexecutable', 'main.c')
    cc = meson.get_compiler('c')
    sizeof_int = cc.sizeof('int')
    
    ```
    
    sizeof_int will be -1, because the compile failed.  The meson logs
    contain the error `testfile.c:7:10: error: no newline at end of file`
    mjgarton authored and eli-schwartz committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    5102f43 View commit details
    Browse the repository at this point in the history