Skip to content

Conversation

@nberth
Copy link

@nberth nberth commented Jul 16, 2025

Before this change enumeration items were duplicated by the default pretty-printer.

Here's a way to check the behavior of the pretty-printer. With test.ml and x.c as follows:

#use "topfind";;
#require "goblint-cil";;
GoblintCil.dumpFile GoblintCil.defaultCilPrinter Stdlib.stdout ""
  (GoblintCil.Frontc.parse "x.c" ());;
enum e { A, B };

Before this PR, test command ocaml ./test.ml | head resulted in

/* Generated by Goblint-CIL v. %%VERSION_NUM%% */
/* print_CIL_Input is false */

#line 1 "x.c"
enum e {
    AA = 0,
    BB = 1
} ;

Before this change enumeration items were duplicated by the default
pretty-printer.
Copy link
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@michael-schwarz michael-schwarz merged commit d1db705 into goblint:develop Jul 17, 2025
13 checks passed
@nberth nberth deleted the fix-pretty-printing-of-enumerations branch July 17, 2025 07:37
@sim642 sim642 added this to the 2.1.0 milestone Jul 29, 2025
@sim642 sim642 added the bug label Jul 29, 2025
sim642 added a commit to sim642/opam-repository that referenced this pull request Sep 2, 2025
CHANGES:

* Add `_Float16` type support (goblint/cil#190, goblint/cil#193).
* Add C23 `alignof` and `alignas` support (goblint/cil#189, goblint/cil#191).
* Add initializer support for anonymous struct in union (goblint/cil#176, goblint/cil#184).
* Fix enumerator printing (goblint/cil#185).
* Remove global state from `Pretty` (goblint/cil#187).
* Remove OCaml <4.12 support (goblint/cil#180, goblint/cil#181).
* Use `gnu11` standard in most tests (goblint/cil#188, goblint/cil#192).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants