[llvm-bugs] [Bug 36002] New: clang-format-6 combines two nearby defines

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 18 05:21:41 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36002

            Bug ID: 36002
           Summary: clang-format-6 combines two nearby defines
           Product: clang
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: me at komzpa.net
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Created attachment 19705
  --> https://bugs.llvm.org/attachment.cgi?id=19705&action=edit
pagc_api.h test file

6.0.0-svn321677-1~exp1

clang-format produces this change that merges OPEN_ALLOCATED_NAME into
PAGC_FILE_OPEN.

File from project PostGIS.


```
-#define PAGC_FILE_OPEN(HANDLE,FNAME,MODE,WHERE,RET) \
-   if ( ( HANDLE = fopen( FNAME , \
-                          MODE ) ) == NULL ) { \
-      RET_ERR1( "\nCan't open: %s\n" ,FNAME,WHERE,RET) ; \
-   }
-
-#define OPEN_ALLOCATED_NAME(ALLOC_NAME,EXT,HANDLE,NAME,MODE,DS_SYS,WHERE,RET)
\
-   if ( ( ALLOC_NAME = ds_alloc_file_name(DS_SYS,NAME,EXT) ) == NULL ) { \
-      return RET ; \
-   } \
-   PAGC_FILE_OPEN(HANDLE,ALLOC_NAME,MODE,WHERE,RET)
-
-
+#define PAGC_FILE_OPEN(HANDLE, FNAME, MODE, WHERE, RET) \
+       if ((HANDLE = fopen(FNAME, MODE)) == NULL) \
+       { RET_ERR1("\nCan't open: %s\n", FNAME, WHERE, RET); } \
+\
+       #define OPEN_ALLOCATED_NAME( \
+           ALLOC_NAME, \
+           EXT, \
+           HANDLE, \
+           NAME, \
+           MODE, \
+           DS_SYS, \
+           WHERE, \
+           RET) if ((ALLOC_NAME = ds_alloc_file_name(DS_SYS, NAME, EXT)) == \
+                    NULL) \
+       { \
+               return RET; \
+       } \
+       PAGC_FILE_OPEN(HANDLE, ALLOC_NAME, MODE, WHERE, RET)
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180118/7fa939eb/attachment.html>


More information about the llvm-bugs mailing list