Merged
Conversation
Commit b01b404 has removed MSVC, but also removed the 'system' line, which was important for its side effect of running the preprocessor (even if the body of the if would never be entered with GCC) Fixes: b01b404 ("Remove remaining MSVC things") Tested with: ``` $ perl -I$(opam var lib)/perl5 lib/perl5/patcher --patch=mypatch.cillypatch --dest=destpatch --ufile caml/misc.h --verbose --mode=GNUCC -I$(ocamlc -where) Patching files for GNU CC version gcc_11 Loaded patches from mypatch.cillypatch Patching "caml/misc.h" Absolute name is /home/edwin/.opam/4.14.0/lib/ocaml/caml/misc.h Destination is destpatch/gcc_11/caml/misc.h ``` With the following mypatch.cillypatch as a test: ``` <<<< #define CAMLprim ==== #define CAMLprim foo >>>> ``` And the patcher has performed the following modification: ``` diff -wu /home/edwin/.opam/4.14.0/lib/ocaml/caml/misc.h destpatch/gcc_11/caml/misc.h --- /home/edwin/.opam/4.14.0/lib/ocaml/caml/misc.h 2022-08-23 09:48:26.263777010 +0100 +++ destpatch/gcc_11/caml/misc.h 2023-01-03 14:25:59.180139744 +0000 @@ -121,7 +121,9 @@ #endif #define CAMLexport -#define CAMLprim +#line 4 "mypatch.cillypatch" +#define CAMLprim foo +#line 125 "/home/edwin/.opam/4.14.0/lib/ocaml/caml/misc.h" #define CAMLextern CAMLDLLIMPORT extern /* Weak function definitions that can be overridden by external libs */ ``` Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Member
|
Thank you! References #52 |
michael-schwarz
approved these changes
Jan 4, 2023
sim642
added a commit
to sim642/opam-repository
that referenced
this pull request
Sep 11, 2023
CHANGES: * Rename `Rmtmps` to `RmUnused` (goblint/cil#135). * Add option to add return statement to `noreturn` functions (goblint/cil#129). * Fix empty `if`s being removed (goblint/cil#140). * Fix `_Float128` support (goblint/cil#118, goblint/cil#119). * Fix C11 `_Alignas` computation (goblint/cil#130). * Fix renaming and merging of `inline` functions based on C standard (goblint/cil#120, goblint/cil#124). * Fix `Pretty` not resetting all global state between calls (goblint/cil#133, goblint/cil#134). * Fix `fundec` location in merger (goblint/cil#139). * Fix `cilly` patcher (goblint/cil#128). * Disable basename by default in parser.
nberth
pushed a commit
to nberth/opam-repository
that referenced
this pull request
Jun 18, 2024
CHANGES: * Rename `Rmtmps` to `RmUnused` (goblint/cil#135). * Add option to add return statement to `noreturn` functions (goblint/cil#129). * Fix empty `if`s being removed (goblint/cil#140). * Fix `_Float128` support (goblint/cil#118, goblint/cil#119). * Fix C11 `_Alignas` computation (goblint/cil#130). * Fix renaming and merging of `inline` functions based on C standard (goblint/cil#120, goblint/cil#124). * Fix `Pretty` not resetting all global state between calls (goblint/cil#133, goblint/cil#134). * Fix `fundec` location in merger (goblint/cil#139). * Fix `cilly` patcher (goblint/cil#128). * Disable basename by default in parser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm not currently using the patcher, but I was trying it out (seems right for patching some OCaml runtime headers for a cusotm CIL analysis) and noticed it wasn't actually working. Looks like a previous patch to remove MSVC was a bit too eager, and actually removed the line that runs the preprocessor. Restore it with this patch.
Commit b01b404 has removed MSVC, but also removed the 'system' line, which was important for its side effect of running the preprocessor (even if the body of the if would never be entered with GCC)
Fixes: b01b404 ("Remove remaining MSVC things")
Tested with:
With the following mypatch.cillypatch as a test:
And the patcher has performed the following modification: