diff --git a/Output/makefile b/Output/makefile index 589d12a..18cff70 100644 --- a/Output/makefile +++ b/Output/makefile @@ -1,4 +1,4 @@ -# @(#)$Id: makefile,v 1.4 2016/06/13 04:06:50 jleffler Exp $ +# @(#)$Id: makefile,v 1.5 2017/10/18 05:56:33 jleffler Exp $ # # Makefile for SCC test output directory @@ -103,6 +103,12 @@ FILES = \ scc-test.ucns-c90.2 \ scc-test.ucns-c99.1 \ scc-test.ucns-c99.2 \ + scc.test-08.example2-e.1 \ + scc.test-08.example2-e.2 \ + scc.test-08.example2-ec.1 \ + scc.test-08.example2-ec.2 \ + scc.test-08.example2-en.1 \ + scc.test-08.example2-en.2 \ all: ${FILES} diff --git a/Output/scc-bogus.ucns-c90.2 b/Output/scc-bogus.ucns-c90.2 index cab6d98..012b8fd 100644 --- a/Output/scc-bogus.ucns-c90.2 +++ b/Output/scc-bogus.ucns-c90.2 @@ -1,125 +1,125 @@ -scc: scc-bogus.ucns.c:15: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:15: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:15: Invalid UCN \u0x detected -scc: scc-bogus.ucns.c:15: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:16: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:15: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:16: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:16: Invalid UCN \u01x detected -scc: scc-bogus.ucns.c:16: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:17: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:16: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:17: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:17: Invalid UCN \u012x detected -scc: scc-bogus.ucns.c:17: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:18: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:18: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:19: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:19: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:20: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:17: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:18: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:18: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:19: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:19: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:20: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:20: Invalid UCN \U000AFFFx detected -scc: scc-bogus.ucns.c:20: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:21: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:20: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:21: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:21: Invalid UCN \U000AFFx detected -scc: scc-bogus.ucns.c:21: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:22: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:21: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:22: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:22: Invalid UCN \U000AFx detected -scc: scc-bogus.ucns.c:22: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:23: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:22: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:23: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:23: Invalid UCN \U000Ax detected -scc: scc-bogus.ucns.c:23: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:24: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:23: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:24: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:24: Invalid UCN \U000x detected -scc: scc-bogus.ucns.c:24: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:25: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:24: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:25: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:25: Invalid UCN \U0Fx detected -scc: scc-bogus.ucns.c:25: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:26: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:25: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:26: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:26: Invalid UCN \U0x detected -scc: scc-bogus.ucns.c:26: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:31: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:32: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:33: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:34: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:35: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:36: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:37: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:38: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:39: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:39: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:40: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:40: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:41: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:41: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:42: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:42: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:43: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:43: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:44: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:44: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:45: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:45: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:46: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:46: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:47: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:48: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:49: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:50: Double slash comment used but not supported in C90 -scc: scc-bogus.ucns.c:50: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:26: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:31: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:32: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:33: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:34: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:35: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:36: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:37: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:38: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:39: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:39: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:40: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:40: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:41: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:41: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:42: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:42: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:43: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:43: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:44: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:44: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:45: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:45: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:46: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:46: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:47: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:48: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:49: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:50: Double slash comment feature used but not supported in C90 +scc: scc-bogus.ucns.c:50: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:50: Invalid UCN \U detected -scc: scc-bogus.ucns.c:51: Double slash comment used but not supported in C90 +scc: scc-bogus.ucns.c:51: Double slash comment feature used but not supported in C90 scc: scc-bogus.ucns.c:51: newline in character constant scc: scc-bogus.ucns.c:52: newline in character constant -scc: scc-bogus.ucns.c:53: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:53: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:53: newline in character constant -scc: scc-bogus.ucns.c:54: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:54: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:54: newline in character constant -scc: scc-bogus.ucns.c:55: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:55: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:55: newline in character constant -scc: scc-bogus.ucns.c:56: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:56: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:56: newline in character constant -scc: scc-bogus.ucns.c:57: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:57: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:57: newline in character constant -scc: scc-bogus.ucns.c:58: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:58: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:58: newline in character constant -scc: scc-bogus.ucns.c:59: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:59: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:59: newline in character constant -scc: scc-bogus.ucns.c:60: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:60: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:60: newline in character constant -scc: scc-bogus.ucns.c:61: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:61: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:61: newline in character constant -scc: scc-bogus.ucns.c:62: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:62: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:62: newline in character constant -scc: scc-bogus.ucns.c:63: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:63: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:63: newline in character constant -scc: scc-bogus.ucns.c:64: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:64: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:64: newline in character constant -scc: scc-bogus.ucns.c:65: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:65: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:65: newline in character constant -scc: scc-bogus.ucns.c:66: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:66: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:66: newline in character constant -scc: scc-bogus.ucns.c:67: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:67: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:67: newline in character constant -scc: scc-bogus.ucns.c:68: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:68: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:68: newline in character constant -scc: scc-bogus.ucns.c:69: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:69: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:69: newline in character constant -scc: scc-bogus.ucns.c:70: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:70: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:70: newline in character constant -scc: scc-bogus.ucns.c:71: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:71: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:71: newline in character constant -scc: scc-bogus.ucns.c:72: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:72: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:72: newline in character constant -scc: scc-bogus.ucns.c:73: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:73: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:73: newline in character constant -scc: scc-bogus.ucns.c:74: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:74: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:74: newline in character constant -scc: scc-bogus.ucns.c:75: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:75: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:75: newline in character constant -scc: scc-bogus.ucns.c:76: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:76: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:76: newline in character constant -scc: scc-bogus.ucns.c:77: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:77: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:77: newline in character constant -scc: scc-bogus.ucns.c:78: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:78: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:78: newline in character constant -scc: scc-bogus.ucns.c:79: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:79: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:79: newline in character constant -scc: scc-bogus.ucns.c:80: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:80: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:80: newline in character constant scc: scc-bogus.ucns.c:81: newline in character constant scc: scc-bogus.ucns.c:82: newline in character constant @@ -127,111 +127,111 @@ scc: scc-bogus.ucns.c:83: newline in character constant scc: scc-bogus.ucns.c:84: newline in character constant scc: scc-bogus.ucns.c:85: newline in character constant scc: scc-bogus.ucns.c:86: newline in character constant -scc: scc-bogus.ucns.c:87: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:87: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:87: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:87: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:87: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:87: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:87: newline in character constant scc: scc-bogus.ucns.c:88: newline in character constant -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:89: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:89: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:89: newline in character constant -scc: scc-bogus.ucns.c:90: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:90: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:90: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:90: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:90: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:90: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:90: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:90: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:90: newline in character constant -scc: scc-bogus.ucns.c:91: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:91: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:91: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:91: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:91: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:91: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:91: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:91: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:91: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:91: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:91: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:91: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:91: newline in character constant -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:92: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:92: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:92: newline in character constant -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:93: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:93: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:93: newline in character constant -scc: scc-bogus.ucns.c:94: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:94: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:94: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:94: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:94: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:94: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:94: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:94: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:94: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:94: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:94: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:94: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:94: newline in character constant -scc: scc-bogus.ucns.c:95: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:95: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:95: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:95: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:95: newline in character constant -scc: scc-bogus.ucns.c:96: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:96: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:96: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:96: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:96: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:96: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:96: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:96: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:96: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:96: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:96: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:96: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:96: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:96: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:96: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:96: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:96: newline in character constant scc: scc-bogus.ucns.c:97: newline in character constant -scc: scc-bogus.ucns.c:98: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:98: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:98: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:98: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:98: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:98: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:98: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:98: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:98: newline in character constant -scc: scc-bogus.ucns.c:99: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:99: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:99: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:99: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:99: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:99: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:99: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:99: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:99: newline in character constant -scc: scc-bogus.ucns.c:100: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:100: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:100: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:100: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:100: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:100: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:100: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:100: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:100: newline in character constant -scc: scc-bogus.ucns.c:101: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:101: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:101: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:101: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:101: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:101: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:101: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:101: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:101: newline in character constant -scc: scc-bogus.ucns.c:102: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:102: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:102: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:102: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:102: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:102: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:102: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:102: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:102: newline in character constant -scc: scc-bogus.ucns.c:103: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:103: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:103: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:103: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:103: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:103: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:103: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:103: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:103: newline in character constant -scc: scc-bogus.ucns.c:104: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:104: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:104: Universal character names feature used but not supported in C90 -scc: scc-bogus.ucns.c:104: Universal character names feature used but not supported in C90 +scc: scc-bogus.ucns.c:104: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:104: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:104: Universal character name feature used but not supported in C90 +scc: scc-bogus.ucns.c:104: Universal character name feature used but not supported in C90 scc: scc-bogus.ucns.c:104: newline in character constant scc: scc-bogus.ucns.c:105: newline in character constant scc: scc-bogus.ucns.c:106: EOF in character constant diff --git a/Output/scc-test.example2-c++98-c-n.1 b/Output/scc-test.example2-c++98-c-n.1 index fddd488..df82091 100644 --- a/Output/scc-test.example2-c++98-c-n.1 +++ b/Output/scc-test.example2-c++98-c-n.1 @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on core functionality @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /* Mainly for testing */ diff --git a/Output/scc-test.example2-c++98-c.1 b/Output/scc-test.example2-c++98-c.1 index fb56da0..bf53c2b 100644 --- a/Output/scc-test.example2-c++98-c.1 +++ b/Output/scc-test.example2-c++98-c.1 @@ -1,9 +1,18 @@ /* @(#)File: $RCSfile: scc-test.example2-c++98-c.1,v $ -@(#)Version: $Revision: 1.1 $ -@(#)Last changed: $Date: 2016/05/22 19:39:46 $ +@(#)Version: $Revision: 1.2 $ +@(#)Last changed: $Date: 2017/10/18 06:38:59 $ @(#)Purpose: Test SCC on core functionality @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 -@(#)Product: SCC Version 6.60 (2016-06-12) -*//* Mainly for testing *//* Retained comments */// C++ style comments// The newline is part of the comment.// The newline should be printed.// The newline should probably still be printed?/* C style *//* or functions *//*EOF*/ \ No newline at end of file +@(#)Product: SCC Version 6.70 (2017-10-17) +*/ +/* Mainly for testing */ +/* Retained comments */ +// C++ style comments +// The newline is part of the comment. +// The newline should be printed. +// The newline should probably still be printed? +/* C style */ +/* or functions */ +/*EOF*/ diff --git a/Output/scc-test.example2-c90-c-n.1 b/Output/scc-test.example2-c90-c-n.1 index 4e557d4..d6cd491 100644 --- a/Output/scc-test.example2-c90-c-n.1 +++ b/Output/scc-test.example2-c90-c-n.1 @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on core functionality @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /* Mainly for testing */ diff --git a/Output/scc-test.example2-c90-c-n.2 b/Output/scc-test.example2-c90-c-n.2 index 747c2ed..54abc9b 100644 --- a/Output/scc-test.example2-c90-c-n.2 +++ b/Output/scc-test.example2-c90-c-n.2 @@ -1,4 +1,4 @@ -scc: scc-test.example2.c:13: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:14: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:15: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:16: Double slash comment used but not supported in C90 +scc: scc-test.example2.c:13: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:14: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:15: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:16: Double slash comment feature used but not supported in C90 diff --git a/Output/scc-test.example2-c90-c.1 b/Output/scc-test.example2-c90-c.1 index a46c6c9..3ed5985 100644 --- a/Output/scc-test.example2-c90-c.1 +++ b/Output/scc-test.example2-c90-c.1 @@ -1,9 +1,14 @@ /* @(#)File: $RCSfile: scc-test.example2-c90-c.1,v $ -@(#)Version: $Revision: 1.1 $ -@(#)Last changed: $Date: 2016/05/22 19:39:46 $ +@(#)Version: $Revision: 1.2 $ +@(#)Last changed: $Date: 2017/10/18 06:38:59 $ @(#)Purpose: Test SCC on core functionality @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 -@(#)Product: SCC Version 6.60 (2016-06-12) -*//* Mainly for testing *//* Retained comments *//* C style *//* or functions *//*EOF*/ \ No newline at end of file +@(#)Product: SCC Version 6.70 (2017-10-17) +*/ +/* Mainly for testing */ +/* Retained comments */ +/* C style */ +/* or functions */ +/*EOF*/ diff --git a/Output/scc-test.example2-c90-c.2 b/Output/scc-test.example2-c90-c.2 index 747c2ed..54abc9b 100644 --- a/Output/scc-test.example2-c90-c.2 +++ b/Output/scc-test.example2-c90-c.2 @@ -1,4 +1,4 @@ -scc: scc-test.example2.c:13: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:14: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:15: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:16: Double slash comment used but not supported in C90 +scc: scc-test.example2.c:13: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:14: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:15: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:16: Double slash comment feature used but not supported in C90 diff --git a/Output/scc-test.example2-c90-n.2 b/Output/scc-test.example2-c90-n.2 index 747c2ed..54abc9b 100644 --- a/Output/scc-test.example2-c90-n.2 +++ b/Output/scc-test.example2-c90-n.2 @@ -1,4 +1,4 @@ -scc: scc-test.example2.c:13: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:14: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:15: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:16: Double slash comment used but not supported in C90 +scc: scc-test.example2.c:13: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:14: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:15: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:16: Double slash comment feature used but not supported in C90 diff --git a/Output/scc-test.example2-c90.2 b/Output/scc-test.example2-c90.2 index 747c2ed..54abc9b 100644 --- a/Output/scc-test.example2-c90.2 +++ b/Output/scc-test.example2-c90.2 @@ -1,4 +1,4 @@ -scc: scc-test.example2.c:13: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:14: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:15: Double slash comment used but not supported in C90 -scc: scc-test.example2.c:16: Double slash comment used but not supported in C90 +scc: scc-test.example2.c:13: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:14: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:15: Double slash comment feature used but not supported in C90 +scc: scc-test.example2.c:16: Double slash comment feature used but not supported in C90 diff --git a/Output/scc-test.example2-c99-c-n.1 b/Output/scc-test.example2-c99-c-n.1 index ded2201..37a8486 100644 --- a/Output/scc-test.example2-c99-c-n.1 +++ b/Output/scc-test.example2-c99-c-n.1 @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on core functionality @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /* Mainly for testing */ diff --git a/Output/scc-test.example2-c99-c.1 b/Output/scc-test.example2-c99-c.1 index e562d1b..253f6a1 100644 --- a/Output/scc-test.example2-c99-c.1 +++ b/Output/scc-test.example2-c99-c.1 @@ -1,9 +1,18 @@ /* @(#)File: $RCSfile: scc-test.example2-c99-c.1,v $ -@(#)Version: $Revision: 1.1 $ -@(#)Last changed: $Date: 2016/05/22 19:39:46 $ +@(#)Version: $Revision: 1.2 $ +@(#)Last changed: $Date: 2017/10/18 06:38:59 $ @(#)Purpose: Test SCC on core functionality @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 -@(#)Product: SCC Version 6.60 (2016-06-12) -*//* Mainly for testing *//* Retained comments */// C++ style comments// The newline is part of the comment.// The newline should be printed.// The newline should probably still be printed?/* C style *//* or functions *//*EOF*/ \ No newline at end of file +@(#)Product: SCC Version 6.70 (2017-10-17) +*/ +/* Mainly for testing */ +/* Retained comments */ +// C++ style comments +// The newline is part of the comment. +// The newline should be printed. +// The newline should probably still be printed? +/* C style */ +/* or functions */ +/*EOF*/ diff --git a/Output/scc-test.example3-c++98.2 b/Output/scc-test.example3-c++98.2 index 9c6b160..27a3ece 100644 --- a/Output/scc-test.example3-c++98.2 +++ b/Output/scc-test.example3-c++98.2 @@ -1,2 +1,2 @@ -scc: scc-test.example3.c:21: Unicode feature used but not supported in C++98 -scc: scc-test.example3.c:22: Unicode feature used but not supported in C++98 +scc: scc-test.example3.c:21: Unicode character or string feature used but not supported in C++98 +scc: scc-test.example3.c:22: Unicode character or string feature used but not supported in C++98 diff --git a/Output/scc-test.example3-c90.2 b/Output/scc-test.example3-c90.2 index 5c4f2f2..e7fcd0b 100644 --- a/Output/scc-test.example3-c90.2 +++ b/Output/scc-test.example3-c90.2 @@ -1,3 +1,3 @@ -scc: scc-test.example3.c:12: Double slash comment used but not supported in C90 -scc: scc-test.example3.c:21: Unicode feature used but not supported in C90 -scc: scc-test.example3.c:22: Unicode feature used but not supported in C90 +scc: scc-test.example3.c:12: Double slash comment feature used but not supported in C90 +scc: scc-test.example3.c:21: Unicode character or string feature used but not supported in C90 +scc: scc-test.example3.c:22: Unicode character or string feature used but not supported in C90 diff --git a/Output/scc-test.example3-c99.2 b/Output/scc-test.example3-c99.2 index ce9e587..39b8cdb 100644 --- a/Output/scc-test.example3-c99.2 +++ b/Output/scc-test.example3-c99.2 @@ -1,2 +1,2 @@ -scc: scc-test.example3.c:21: Unicode feature used but not supported in C99 -scc: scc-test.example3.c:22: Unicode feature used but not supported in C99 +scc: scc-test.example3.c:21: Unicode character or string feature used but not supported in C99 +scc: scc-test.example3.c:22: Unicode character or string feature used but not supported in C99 diff --git a/Output/scc-test.numpunct-c++11.2 b/Output/scc-test.numpunct-c++11.2 index 0423dc0..ca745f1 100644 --- a/Output/scc-test.numpunct-c++11.2 +++ b/Output/scc-test.numpunct-c++11.2 @@ -1,9 +1,9 @@ scc: scc-test.numpunct.cpp:11: Numeric punctuation feature used but not supported in C++11 scc: scc-test.numpunct.cpp:11: Numeric punctuation feature used but not supported in C++11 -scc: scc-test.numpunct.cpp:11: Hexadecimal floating point constant used but not supported in C++11 +scc: scc-test.numpunct.cpp:11: Hexadecimal floating point constant feature used but not supported in C++11 scc: scc-test.numpunct.cpp:12: Numeric punctuation feature used but not supported in C++11 scc: scc-test.numpunct.cpp:12: Numeric punctuation feature used but not supported in C++11 -scc: scc-test.numpunct.cpp:12: Hexadecimal floating point constant used but not supported in C++11 +scc: scc-test.numpunct.cpp:12: Hexadecimal floating point constant feature used but not supported in C++11 scc: scc-test.numpunct.cpp:13: Binary literal feature used but not supported in C++11 scc: scc-test.numpunct.cpp:13: Numeric punctuation feature used but not supported in C++11 scc: scc-test.numpunct.cpp:14: Binary literal feature used but not supported in C++11 diff --git a/Output/scc-test.numpunct-c++14.2 b/Output/scc-test.numpunct-c++14.2 index 3ab822e..ebcca64 100644 --- a/Output/scc-test.numpunct-c++14.2 +++ b/Output/scc-test.numpunct-c++14.2 @@ -1,2 +1,2 @@ -scc: scc-test.numpunct.cpp:11: Hexadecimal floating point constant used but not supported in C++14 -scc: scc-test.numpunct.cpp:12: Hexadecimal floating point constant used but not supported in C++14 +scc: scc-test.numpunct.cpp:11: Hexadecimal floating point constant feature used but not supported in C++14 +scc: scc-test.numpunct.cpp:12: Hexadecimal floating point constant feature used but not supported in C++14 diff --git a/Output/scc-test.rawstring-c11.2 b/Output/scc-test.rawstring-c11.2 index f68444e..7332d33 100644 --- a/Output/scc-test.rawstring-c11.2 +++ b/Output/scc-test.rawstring-c11.2 @@ -1,15 +1,15 @@ -scc: scc-test.rawstring.cpp:34: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:37: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:38: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:40: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:42: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:44: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:46: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:51: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:154: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:162: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:167: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:169: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:176: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:177: Raw string used but not supported in C11 -scc: scc-test.rawstring.cpp:179: Raw string used but not supported in C11 +scc: scc-test.rawstring.cpp:34: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:37: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:38: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:40: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:42: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:44: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:46: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:51: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:154: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:162: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:167: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:169: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:176: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:177: Raw string feature used but not supported in C11 +scc: scc-test.rawstring.cpp:179: Raw string feature used but not supported in C11 diff --git a/Output/scc-test.ucns-c90.2 b/Output/scc-test.ucns-c90.2 index eb5685c..1cf2a0d 100644 --- a/Output/scc-test.ucns-c90.2 +++ b/Output/scc-test.ucns-c90.2 @@ -1,23 +1,23 @@ -scc: scc-test.ucns.c:33: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:37: Universal character names feature used but not supported in C90 -scc: scc-test.ucns.c:38: Universal character names feature used but not supported in C90 -scc: scc-test.ucns.c:39: Universal character names feature used but not supported in C90 -scc: scc-test.ucns.c:72: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:94: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:95: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:96: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:101: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:106: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:111: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:124: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:141: Universal character names feature used but not supported in C90 -scc: scc-test.ucns.c:142: Universal character names feature used but not supported in C90 -scc: scc-test.ucns.c:142: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:143: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:143: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:144: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:144: Universal character names feature used but not supported in C90 -scc: scc-test.ucns.c:144: Double slash comment used but not supported in C90 -scc: scc-test.ucns.c:145: Universal character names feature used but not supported in C90 -scc: scc-test.ucns.c:146: Universal character names feature used but not supported in C90 -scc: scc-test.ucns.c:147: Universal character names feature used but not supported in C90 +scc: scc-test.ucns.c:33: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:37: Universal character name feature used but not supported in C90 +scc: scc-test.ucns.c:38: Universal character name feature used but not supported in C90 +scc: scc-test.ucns.c:39: Universal character name feature used but not supported in C90 +scc: scc-test.ucns.c:72: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:94: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:95: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:96: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:101: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:106: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:111: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:124: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:141: Universal character name feature used but not supported in C90 +scc: scc-test.ucns.c:142: Universal character name feature used but not supported in C90 +scc: scc-test.ucns.c:142: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:143: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:143: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:144: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:144: Universal character name feature used but not supported in C90 +scc: scc-test.ucns.c:144: Double slash comment feature used but not supported in C90 +scc: scc-test.ucns.c:145: Universal character name feature used but not supported in C90 +scc: scc-test.ucns.c:146: Universal character name feature used but not supported in C90 +scc: scc-test.ucns.c:147: Universal character name feature used but not supported in C90 diff --git a/Output/scc.test-08.example2-e.1 b/Output/scc.test-08.example2-e.1 new file mode 100644 index 0000000..95819de --- /dev/null +++ b/Output/scc.test-08.example2-e.1 @@ -0,0 +1,14 @@ +/* */ + +/* */ +/* */ +Including trailing // +What is the correct behaviour? // +// +And with comment stripping? // +So that this text appears on a separate line from the question. +And what about newlines and /* */ comments when they are retained? +Perhaps a newline should be generated when the line had a comment on it somewhere? +Which function /* */ controls this? + +/* */ diff --git a/Output/scc.test-08.example2-e.2 b/Output/scc.test-08.example2-e.2 new file mode 100644 index 0000000..e69de29 diff --git a/Output/scc.test-08.example2-ec.1 b/Output/scc.test-08.example2-ec.1 new file mode 100644 index 0000000..f81e6f8 --- /dev/null +++ b/Output/scc.test-08.example2-ec.1 @@ -0,0 +1,18 @@ +/* +@(#)File: $RCSfile: scc.test-08.example2-ec.1,v $ +@(#)Version: $Revision: 1.2 $ +@(#)Last changed: $Date: 2017/10/18 06:38:59 $ +@(#)Purpose: Test SCC on core functionality +@(#)Author: J Leffler +@(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 +@(#)Product: SCC Version 6.70 (2017-10-17) +*/ +/* Mainly for testing */ +/* Retained comments */ +// C++ style comments +// The newline is part of the comment. +// The newline should be printed. +// The newline should probably still be printed? +/* C style */ +/* or functions */ +/*EOF*/ diff --git a/Output/scc.test-08.example2-ec.2 b/Output/scc.test-08.example2-ec.2 new file mode 100644 index 0000000..e69de29 diff --git a/Output/scc.test-08.example2-en.1 b/Output/scc.test-08.example2-en.1 new file mode 100644 index 0000000..a81fc95 --- /dev/null +++ b/Output/scc.test-08.example2-en.1 @@ -0,0 +1,22 @@ +/* + + + + + + + + */ + +/* */ +/* */ +Including trailing // +What is the correct behaviour? // +// +And with comment stripping? // +So that this text appears on a separate line from the question. +And what about newlines and /* */ comments when they are retained? +Perhaps a newline should be generated when the line had a comment on it somewhere? +Which function /* */ controls this? + +/* */ diff --git a/Output/scc.test-08.example2-en.2 b/Output/scc.test-08.example2-en.2 new file mode 100644 index 0000000..e69de29 diff --git a/errhelp.c b/errhelp.c index 0a54f2e..feab580 100644 --- a/errhelp.c +++ b/errhelp.c @@ -5,7 +5,7 @@ @(#)Purpose: Print usage and help message in standard format. @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2007-09 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /*TABSTOP=4*/ diff --git a/filter.c b/filter.c index d823a7a..9f75dfd 100644 --- a/filter.c +++ b/filter.c @@ -5,7 +5,7 @@ @(#)Purpose: Classic File Filter @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1987-89,1991,1993,1996-99,2002-05,2008,2012,2014-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /*TABSTOP=4*/ diff --git a/filter.h b/filter.h index c6f9da9..e328a16 100644 --- a/filter.h +++ b/filter.h @@ -5,7 +5,7 @@ @(#)Purpose: Header for filter functions @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1993,1995-98,2003-04,2006,2008,2014-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /*TABSTOP=4*/ diff --git a/filterio.c b/filterio.c index 7d326b5..7b83c11 100644 --- a/filterio.c +++ b/filterio.c @@ -5,7 +5,7 @@ @(#)Purpose: Perform standardized I/O error check for filter programs @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2003,2005,2008,2014 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /*TABSTOP=4*/ diff --git a/makefile b/makefile index 3c0866e..bf145b0 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,8 @@ -# @(#)$Id: makefile,v 1.6 2016/06/11 22:26:40 jleffler Exp $ +# @(#)$Id: makefile,v 1.8 2017/10/18 05:50:43 jleffler Exp $ # -# Makefile for SCC (Strip C/C++ Comments) +# Release Makefile for SCC (Strip C/C++ Comments) +# +# No access to JLSS libraries - use scc.mk for that. PROGRAM = scc SOURCE = errhelp.c filter.c filterio.c stderr.c scc.c @@ -28,6 +30,7 @@ TEST_SCRIPTS = \ scc.test-05.sh \ scc.test-06.sh \ scc.test-07.sh \ + scc.test-08.sh \ all: ${PROGRAM} ${TESTTOOLS} diff --git a/posixver.h b/posixver.h index d7cf822..808bd8e 100644 --- a/posixver.h +++ b/posixver.h @@ -1,11 +1,11 @@ /* @(#)File: $RCSfile: posixver.h,v $ -@(#)Version: $Revision: 1.3 $ -@(#)Last changed: $Date: 2015/07/05 21:28:18 $ +@(#)Version: $Revision: 1.4 $ +@(#)Last changed: $Date: 2017/06/18 00:15:42 $ @(#)Purpose: Request appropriate POSIX and X/Open Support @(#)Author: J Leffler -@(#)Copyright: (C) JLSS 2010,2015 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Copyright: (C) JLSS 2010-2017 +@(#)Product: SCC Version 6.70 (2017-10-17) */ /*TABSTOP=4*/ @@ -15,7 +15,7 @@ /* ** Include this file before including system headers. By default, with -** C99 support from the compiler, it requests POSIX 2001 support. With +** C99 support from the compiler, it requests POSIX 2008 support. With ** C89 support only, it requests POSIX 1997 support. Override the ** default behaviour by setting either _XOPEN_SOURCE or _POSIX_C_SOURCE. */ diff --git a/rcskwreduce.sh b/rcskwreduce.sh index 54784e2..2b65a7a 100644 --- a/rcskwreduce.sh +++ b/rcskwreduce.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# @(#)$Id| +# @(#)$Id: rcskwreduce.sh,v 1.2 2017/10/11 21:07:52 jleffler Exp $ # # Normalize (reduce) expanded RCS keywords to minimal form. diff --git a/scc-6.60.sum b/scc-6.60.sum deleted file mode 100644 index 5357741..0000000 --- a/scc-6.60.sum +++ /dev/null @@ -1 +0,0 @@ -SHA-256 60ac6efcaf19f7bc36c932321df956559ababd1e62a27f4db59a806cfeac00b5 13912 scc-6.60.sha diff --git a/scc-6.60.sha b/scc-6.70.sha similarity index 63% rename from scc-6.60.sha rename to scc-6.70.sha index 7895ed0..7f27334 100644 --- a/scc-6.60.sha +++ b/scc-6.70.sha @@ -1,4 +1,4 @@ -SHA-256 22dc48e5142a00d6b9ab2da28ca667dd1f20c16719af322f03f897a7401df463 2851 Output/makefile +SHA-256 377c9ad8b71006d610115aa6b882e0a61276a019cfbfec4ee0df170c69b8813e 3023 Output/makefile SHA-256 197327d4c51588779c2f1e0c27bc4e4e9cf61d4a20328c71ed98d2efee1a7fd5 209 Output/scc-bogus.binary-c++11.1 SHA-256 2e723be37dcd7b7e4f77090fda75391f4594d84737ee7b044a29f76bd8cfc1f4 1984 Output/scc-bogus.binary-c++11.2 SHA-256 197327d4c51588779c2f1e0c27bc4e4e9cf61d4a20328c71ed98d2efee1a7fd5 209 Output/scc-bogus.binary-c++14.1 @@ -18,7 +18,7 @@ SHA-256 d12e3a4a2bec59d26d863946fbe0d1dcd832ae3b24ceaf61b295c964c4cc0522 54 SHA-256 c25ae997042e9caf684070836e590837b92bb4908cd57d8eb5ee234de182b27a 2499 Output/scc-bogus.ucns-c11.1 SHA-256 d12e3a4a2bec59d26d863946fbe0d1dcd832ae3b24ceaf61b295c964c4cc0522 544 Output/scc-bogus.ucns-c11.2 SHA-256 e44f5a2bc6bb7d7ee5d24ff7aeae7218ba195906ab8abdf139e9ae200b772140 3602 Output/scc-bogus.ucns-c90.1 -SHA-256 c84a1675fb8923657b3d5207e86bad7764b208ecbfca93342c4bed7fb1e3308b 18755 Output/scc-bogus.ucns-c90.2 +SHA-256 7438349e8de4cd6642c8099c3367cb9279c7b81863cdbd6caf952a2e28c6d432 18792 Output/scc-bogus.ucns-c90.2 SHA-256 c25ae997042e9caf684070836e590837b92bb4908cd57d8eb5ee234de182b27a 2499 Output/scc-bogus.ucns-c99.1 SHA-256 d12e3a4a2bec59d26d863946fbe0d1dcd832ae3b24ceaf61b295c964c4cc0522 544 Output/scc-bogus.ucns-c99.2 SHA-256 3774a84657d24ec4a1ca4cecf80f24b491d908b5a5e10a16857f0594a959394a 116 Output/scc-test.binary-c++11.1 @@ -29,25 +29,25 @@ SHA-256 3774a84657d24ec4a1ca4cecf80f24b491d908b5a5e10a16857f0594a959394a 11 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.binary-c++17.2 SHA-256 3774a84657d24ec4a1ca4cecf80f24b491d908b5a5e10a16857f0594a959394a 116 Output/scc-test.binary-c.1 SHA-256 041491dcf54c82efd7a234d171e72930be91f41dedb9172a9c4c49ab3f2de2da 995 Output/scc-test.binary-c.2 -SHA-256 d1ee1260d45689d7f711345bd3c5cc7a6ba54aa858466729953f246528c3479e 577 Output/scc-test.example2-c++98-c-n.1 +SHA-256 78605938d2d0ac32e422bc069ab20f5800aa6774dedbca683f7f449aa55afb06 577 Output/scc-test.example2-c++98-c-n.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example2-c++98-c-n.2 -SHA-256 4e44c1eddd738b50365ebc18b15a95a0a0e8ce2df8fdc44c289f6ac89f13f731 561 Output/scc-test.example2-c++98-c.1 +SHA-256 9bb16619f43df7898aeccc8a4c753f225a0f695e1fe2a9d08a283a95ec165202 571 Output/scc-test.example2-c++98-c.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example2-c++98-c.2 SHA-256 af6dfd76126b626a98445d699c00ec10e15beddbd34831ac60720f185b06a352 344 Output/scc-test.example2-c++98-n.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example2-c++98-n.2 SHA-256 fddad0e4795f74f34deb06ac5587549a23ddc3702879ac54eea4e5e6349dda15 336 Output/scc-test.example2-c++98.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example2-c++98.2 -SHA-256 18d49883df6109d880ad6896def154d01894b83926de252cd77359f4e0dd58b0 435 Output/scc-test.example2-c90-c-n.1 -SHA-256 ed94fb84312aac3f070dd241b0efdf920d23fbcf9b71ceda5a09cfde0a4ad44c 320 Output/scc-test.example2-c90-c-n.2 -SHA-256 91f49e6d2dbff1359af715285ef416ffe42a18a6ace0c0602e0a8e9e4c269477 419 Output/scc-test.example2-c90-c.1 -SHA-256 ed94fb84312aac3f070dd241b0efdf920d23fbcf9b71ceda5a09cfde0a4ad44c 320 Output/scc-test.example2-c90-c.2 +SHA-256 13b835ac59f7aa13c063ab869b8963a7640fc7b784f86547d5da873d79f166ba 435 Output/scc-test.example2-c90-c-n.1 +SHA-256 32ff2a26ea368003ec9739e06de43eb142ae17b7c2ca11ba93da5aee2d0309b2 352 Output/scc-test.example2-c90-c-n.2 +SHA-256 6cd3ad1679f5d8443d13ff05009c0e459c4a989b7ea0d1c917f7ecf705e2e3a1 425 Output/scc-test.example2-c90-c.1 +SHA-256 32ff2a26ea368003ec9739e06de43eb142ae17b7c2ca11ba93da5aee2d0309b2 352 Output/scc-test.example2-c90-c.2 SHA-256 85f31f6ca6b696a633579a12eff23c2296c18a1f1d629be996e27da4070575b1 484 Output/scc-test.example2-c90-n.1 -SHA-256 ed94fb84312aac3f070dd241b0efdf920d23fbcf9b71ceda5a09cfde0a4ad44c 320 Output/scc-test.example2-c90-n.2 +SHA-256 32ff2a26ea368003ec9739e06de43eb142ae17b7c2ca11ba93da5aee2d0309b2 352 Output/scc-test.example2-c90-n.2 SHA-256 a950a28b78c1ce9b2a83719f828606ae1cfb66fbc4fab34d204153f32fd0d381 476 Output/scc-test.example2-c90.1 -SHA-256 ed94fb84312aac3f070dd241b0efdf920d23fbcf9b71ceda5a09cfde0a4ad44c 320 Output/scc-test.example2-c90.2 -SHA-256 ad4df599e25df62be1913043176dcc75e9a6f60f8b4c21c7468cc8ecdf956b29 575 Output/scc-test.example2-c99-c-n.1 +SHA-256 32ff2a26ea368003ec9739e06de43eb142ae17b7c2ca11ba93da5aee2d0309b2 352 Output/scc-test.example2-c90.2 +SHA-256 ef20ce3623ba5f5267ffc0862da32bd61491eb913e56714f690cfd1db70edb4b 575 Output/scc-test.example2-c99-c-n.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example2-c99-c-n.2 -SHA-256 6d132ff7391c57c051945d3ac10474a64114070fdecabd590700661db352be10 559 Output/scc-test.example2-c99-c.1 +SHA-256 9839ff8bcf978fd1bf8e9225a572a52b5957d6b0d9d2e4eb323e15588ad698ef 569 Output/scc-test.example2-c99-c.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example2-c99-c.2 SHA-256 af6dfd76126b626a98445d699c00ec10e15beddbd34831ac60720f185b06a352 344 Output/scc-test.example2-c99-n.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example2-c99-n.2 @@ -60,17 +60,17 @@ SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 SHA-256 f3603f64dc709311ed14173495ce0cc8cfeb60fd0b0068e3872e9b4b54ddfc65 281 Output/scc-test.example3-c++17.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example3-c++17.2 SHA-256 f3603f64dc709311ed14173495ce0cc8cfeb60fd0b0068e3872e9b4b54ddfc65 281 Output/scc-test.example3-c++98.1 -SHA-256 50ecc08aed763af020ddfe7535c4b82db122deb9c1006e772c10a08185f80bd7 154 Output/scc-test.example3-c++98.2 +SHA-256 165b2148b8ffc97d1be34ac06aeb664d0e763f06d0d00963b3a9328029345f51 194 Output/scc-test.example3-c++98.2 SHA-256 f3603f64dc709311ed14173495ce0cc8cfeb60fd0b0068e3872e9b4b54ddfc65 281 Output/scc-test.example3-c11.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.example3-c11.2 SHA-256 a34d6a22a0cc70652ff63a0138e271e9ed6ff1dcfec9d9035e6ad02537375aac 301 Output/scc-test.example3-c90.1 -SHA-256 edcac9657eaf29d13cdfa8137bd345f3e87e3cbd8706fa9e5dddb82ae81d1f8d 230 Output/scc-test.example3-c90.2 +SHA-256 05f7bf417ff36aec82d6ad4f674d700457874812490a2089b6179aec6ceda47e 278 Output/scc-test.example3-c90.2 SHA-256 f3603f64dc709311ed14173495ce0cc8cfeb60fd0b0068e3872e9b4b54ddfc65 281 Output/scc-test.example3-c99.1 -SHA-256 5ac07a5dded8ca70980ad2c74a0a54695e992b6b8926e48c387534ea1eb4ffff 150 Output/scc-test.example3-c99.2 +SHA-256 a7ae85a13c97d0f3cff68c93506d0d9bfae395dc6034689939f4a2c984cb04b9 190 Output/scc-test.example3-c99.2 SHA-256 28b39140b92e47e2fd36621214e552a101200521a182b27a1c67482745390e4f 331 Output/scc-test.numpunct-c++11.1 -SHA-256 37a7b20a1a6f09f342b012c3fd5fb370cbe9f37f4588f84c2b0803e55870b8ea 3186 Output/scc-test.numpunct-c++11.2 +SHA-256 db80dbd6ce436bada910a9833ad427dd2802f443f8b293e90fe34fac5beafbb3 3202 Output/scc-test.numpunct-c++11.2 SHA-256 28b39140b92e47e2fd36621214e552a101200521a182b27a1c67482745390e4f 331 Output/scc-test.numpunct-c++14.1 -SHA-256 137ce0216904e321d0a899ac8c80470422941e4a930a43c905c6ffa64d5f84e3 198 Output/scc-test.numpunct-c++14.2 +SHA-256 47230c817e4e643d8fbca6ac3dea9619553a3dcd64d27b08962009acc9287dbd 214 Output/scc-test.numpunct-c++14.2 SHA-256 28b39140b92e47e2fd36621214e552a101200521a182b27a1c67482745390e4f 331 Output/scc-test.numpunct-c++17.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.numpunct-c++17.2 SHA-256 28b39140b92e47e2fd36621214e552a101200521a182b27a1c67482745390e4f 331 Output/scc-test.numpunct-c.1 @@ -82,7 +82,7 @@ SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 SHA-256 8b0d18bf2193b9d5380f0d81ef9c1f6437cb355225e50f83521af836a4d0b525 6500 Output/scc-test.rawstring-c++17.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.rawstring-c++17.2 SHA-256 c2dd0423f022dea76a26a09d93c278af2e62602917d95a38c9018949f754c87f 6498 Output/scc-test.rawstring-c11.1 -SHA-256 22029927e398545b58725b316dee9519c4a495cfdbd48acc888217ab81dbf4c6 1102 Output/scc-test.rawstring-c11.2 +SHA-256 9bc848fa45cf3b414844fa82e32792734b6e1a7616f1e229984b2d91e9232c23 1222 Output/scc-test.rawstring-c11.2 SHA-256 7b8b1b00186ecd6ce2a4cd81b85ca22acd9b2261017c3dffd063c6f6ecc829fb 1212 Output/scc-test.ucns-c++11.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.ucns-c++11.2 SHA-256 7b8b1b00186ecd6ce2a4cd81b85ca22acd9b2261017c3dffd063c6f6ecc829fb 1212 Output/scc-test.ucns-c++14.1 @@ -94,34 +94,41 @@ SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 SHA-256 7b8b1b00186ecd6ce2a4cd81b85ca22acd9b2261017c3dffd063c6f6ecc829fb 1212 Output/scc-test.ucns-c11.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.ucns-c11.2 SHA-256 4b1ae703892a2c8123072b18c14b6cc23cccb9589e919c7831c9ea541548f3e9 1679 Output/scc-test.ucns-c90.1 -SHA-256 c49dca5ec43cb802f4f1f92b19d56e4c624fdc7251f401edfd3fbb4637bee8aa 1880 Output/scc-test.ucns-c90.2 +SHA-256 bdf5419b6c5ffcde01b02e106d084c8a76d85bcaf08efaa2d24bf97c4b514e2e 1983 Output/scc-test.ucns-c90.2 SHA-256 7b8b1b00186ecd6ce2a4cd81b85ca22acd9b2261017c3dffd063c6f6ecc829fb 1212 Output/scc-test.ucns-c99.1 SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc-test.ucns-c99.2 -SHA-256 6e097279680faec47bf86367c2ed3e869bdde985e80ebc31bc6db6a947eace0d 2174 errhelp.c -SHA-256 e7a3d514dee1ea936ecb53648d804ad72890447a4bd640a3585a9935cad6c593 4165 filter.c -SHA-256 fe8758ed22e566df6c2b372f2493ef60a266a87c3f9d6bed5fc32cf544a84e43 3262 filter.h -SHA-256 9f46b00c6ce6647a78af83dfa751b939ae6ff11ee099f5582508f406d57162ab 1983 filterio.c -SHA-256 7bff1e38bbd62d2d3307bd9970582e29d4577e9ce17b56a527a2cb31db15d8ca 1405 makefile -SHA-256 ad01b70afeeef904852a97f0aaf5558f3cfb2b35317638c2cf026af2e75aabfe 1354 posixver.h -SHA-256 e7c6e6d33a6571f273cd587b014ee6a6455516e82ddf8bd5a3e937f3dabf4b10 213 rcskwreduce.sh -SHA-256 e58ec7b4fb920d7f2877bf9ec435cb0d1454da5abd2de362a39a4f24c4299c16 653 scc-bogus.binary.cpp -SHA-256 30f9cd07c17b1c6876040a97d4bbbf49bbef50e89a75eb07d41f665c80b7c059 4084 scc-bogus.ucns.c -SHA-256 0c9418fb9bac61ea83724fc1195cf2d6133fc7b993d6ae4a9fda2fda821f1673 445 scc-test.binary.cpp -SHA-256 25d954c701ba6ebf13c9a1c8756da238f212b09a8a37cd045820ef1c59f54db3 4342 scc-test.example1.c -SHA-256 ab53d293fdfd494cb8b7589a2811e9813025e57183cf66b77a602065c87f65c3 883 scc-test.example2.c -SHA-256 18ebcbd690326081ba38692d90871e5aa10f4bceaeff902dadfd06dce855953c 669 scc-test.example3.c -SHA-256 ab18e7b59ef0f6b38a3e0ebfd4dd63dae349659fdd90ef4353cecb3f63a16500 1357 scc-test.hexfloat.cpp -SHA-256 8b6be3485086a413f3def72b1663e677b7d4c26fdf02cc97a48df7457cf1e5f2 675 scc-test.numpunct.cpp -SHA-256 a309a7b5322582abfe7684d271fb9ab170d8a28e49580a8295b6f922bc5c188d 7893 scc-test.rawstring.cpp -SHA-256 eba3f83b93cfccd960741c7fae54559c5bf38d5d48ffae47e1b8b0c85903510a 3218 scc-test.ucns.c -SHA-256 eb593fcc05cfa82b533c665881236f114299205aa93304ab6119ac461baa643c 3170 scc.1 -SHA-256 9297d6cdcd2cdb5a31e10ac22a4c11795139afd76649179559d030dd0a15f5d3 34902 scc.c -SHA-256 9b3778361fd78bdadc39499ed6ff48dfe66db1b992a423365013f1f43f45c25d 3071 scc.test-01.sh +SHA-256 2e921861ddf29d9c9ffab0632e5549647623547967ad17923ae98dbf24e30fc7 368 Output/scc.test-08.example2-e.1 +SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc.test-08.example2-e.2 +SHA-256 5f83459676bfc19f5f917798e98fb9dc7924ef1ba55fb97e01fb6689424f9966 569 Output/scc.test-08.example2-ec.1 +SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc.test-08.example2-ec.2 +SHA-256 fd816fa1f688cffa233f3d300757e831183c290f6fc016fb57e4ea14259f33f0 376 Output/scc.test-08.example2-en.1 +SHA-256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Output/scc.test-08.example2-en.2 +SHA-256 9133d457723497a7bd6e8412e782aad6be23d4db8911af8642cf5356210be1fb 2174 errhelp.c +SHA-256 a943bc6ed7a5f1ea92367419d8db82669a51aba7882a0e391027494a2ee0e84b 4165 filter.c +SHA-256 fd503e6b0b831b2a9b88dc529d9765beb633f3c2019fc3af45afccbaa0859300 3262 filter.h +SHA-256 a6a142d97f63d11379583466d5c8d9028fdf1c946251b080b0bc44e6bd3a0a22 1983 filterio.c +SHA-256 d97130c1a8d4ad4d8ace6447a53177bbcdcbf546b23d708e5e674acbde022f3d 1486 makefile +SHA-256 a3825cf0b46d609495e0d41743e2e16754d76913d0ea94726832ddbe48736393 1354 posixver.h +SHA-256 373ab8b5e76c7fe3c7bcd5e0919f40f574b56ea6f1ab80c4177d1ae9fbc682bf 269 rcskwreduce.sh +SHA-256 657284a7008b57916a8cde10e5a9fe1ff0e8e2f3d04892fe19a5ba3de10c7c54 653 scc-bogus.binary.cpp +SHA-256 758f60bcfd2fff8e5f340d1c79e34da7dd4fab84829d7a0715cba88e62489417 4084 scc-bogus.ucns.c +SHA-256 85f1bf28e1ce71ca4f26539c3b19740b83a0e1f89377323fb2dc28dc8c2687f1 445 scc-test.binary.cpp +SHA-256 43794fbe1036cfc3dde9ca4fe28588eb5f0abc769fe77a7868bdb82b298e2a9d 4342 scc-test.example1.c +SHA-256 5e5a4d2f9305ce749d5b7d5bc0ed877001f2514be35f1daafacc9aed781065d9 883 scc-test.example2.c +SHA-256 d24f4ab1cb7fcddde6069b69bcddc8e38f102f6fade184d1c193254f3f018815 669 scc-test.example3.c +SHA-256 cc9f4aa0861051d6ef503faf71cce95ee8d656909057dda9cf2a31bbd867e73c 1357 scc-test.hexfloat.cpp +SHA-256 792847fe11a370dece7cf9d55d5586806ed6f230a1d4a619a24006f826ca001d 675 scc-test.numpunct.cpp +SHA-256 7da9e771a449eaef1d29b9db2d8150d514776bf7b82f38a42a1b393ac637d8f9 7893 scc-test.rawstring.cpp +SHA-256 75a494e4a1c908e5dcbff4f46d8bf2f0b4e217818f932de2aab383746ceb704b 3218 scc-test.ucns.c +SHA-256 6c6383bdceb6f7c9acbab18e0ead2c36ce8c3e4f4aaa8c23217f30158c00d117 3432 scc.1 +SHA-256 d8c5be902d6e37705d70435f322f3ff83a2fce4479c744f96a484a826da3d5d8 35148 scc.c +SHA-256 b90d29ef8ec738741fc571b43643de981b1d9c9d400d49897d65f12e03c2bab0 3083 scc.test-01.sh SHA-256 4464abf10d560f44bda778a06712e28f8dfb3e30e72c18df353a6e3babbcd5f9 2544 scc.test-02.sh SHA-256 a85410ee143794b67ce2ec2a85580cec2b2155be2eeaf0b2861b29916cb4a854 2555 scc.test-03.sh -SHA-256 cd477a1ab81ba2f16b9fb793053175dcb046507f008ba26d0c355cc18c05b737 1977 scc.test-04.sh -SHA-256 51a96c74c472a20167aa6ceb2cda9de5858a0e10ab8560b28e6fe577579794f1 2096 scc.test-05.sh -SHA-256 11fc8c9597c1231c06d24baec33f949058e076740942062ba91529277305f4e0 2204 scc.test-06.sh +SHA-256 85373e9db4ebe14c59163e884bd026b3330752c71724eacecc296c0762f3c182 2157 scc.test-04.sh +SHA-256 f7c86a8b54b021bac85f7942bd53c85775883a5804a179f89bca16851a1e0d38 2191 scc.test-05.sh +SHA-256 86be3af4ac0c42a76d58c62274f78e51acd62414fc7c791b5a6e5da1190583f7 2299 scc.test-06.sh SHA-256 b9621cb3af0768d2add7b3b6b1cfe6470b025f8a6e307b0adf61d169f1837eaa 2039 scc.test-07.sh -SHA-256 9aeb2c1c337e1dba82395b4b1816febb6f9fb8a4d97840621649c78ec7a04398 19889 stderr.c -SHA-256 bcf7d934c1d6259ce5349e9f3120e502119a4a6430935e5c0d3277137ae2ef21 7073 stderr.h +SHA-256 37aae7c68349968cbbde67feb104e96def5c1c17ea60146836edb4720568fa17 1985 scc.test-08.sh +SHA-256 d2e89d3a2c3feec62cbf8e4bd17a27361903396eb3c9b74f725cb82d1876f3bc 20548 stderr.c +SHA-256 19460e584319e65bad571fbe96e0bb0177fd1a3a49a48a13ea4a0a60662279b6 7713 stderr.h diff --git a/scc-6.70.sum b/scc-6.70.sum new file mode 100644 index 0000000..fbc063c --- /dev/null +++ b/scc-6.70.sum @@ -0,0 +1 @@ +SHA-256 de6e036584e9129a1274a802630fcfdf85901c3e07e805e5efcda083cb12f653 14697 scc-6.70.sha diff --git a/scc-bogus.binary.cpp b/scc-bogus.binary.cpp index b835123..7911389 100644 --- a/scc-bogus.binary.cpp +++ b/scc-bogus.binary.cpp @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on bogus C++14 binary numbers @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2014 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ int i = 0b'0100; // Quote without digit before diff --git a/scc-bogus.ucns.c b/scc-bogus.ucns.c index bbffb5b..56c494c 100644 --- a/scc-bogus.ucns.c +++ b/scc-bogus.ucns.c @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on broken Unicode characters @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2016 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /* Compile with -fextended-identifiers */ diff --git a/scc-test.binary.cpp b/scc-test.binary.cpp index f339cf4..95dc4ad 100644 --- a/scc-test.binary.cpp +++ b/scc-test.binary.cpp @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on C++14 binary numbers @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2014 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ int i = 0b0100; diff --git a/scc-test.example1.c b/scc-test.example1.c index f72457a..4ee1c03 100644 --- a/scc-test.example1.c +++ b/scc-test.example1.c @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on core functionality @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /*TABSTOP=4*/ diff --git a/scc-test.example2.c b/scc-test.example2.c index ead258e..e93d535 100644 --- a/scc-test.example2.c +++ b/scc-test.example2.c @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on core functionality @(#)Author: J Leffler @(#)Copyright: (C) JLSS 1997,2003,2007,2013-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /* Mainly for testing */ diff --git a/scc-test.example3.c b/scc-test.example3.c index d65cc84..8a8d992 100644 --- a/scc-test.example3.c +++ b/scc-test.example3.c @@ -5,7 +5,7 @@ @(#)Purpose: Test handling of C11 (and C++11) Unicode characters and strings. @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2016 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ #include /* wchar_t */ diff --git a/scc-test.hexfloat.cpp b/scc-test.hexfloat.cpp index c320f3f..3a38f7d 100644 --- a/scc-test.hexfloat.cpp +++ b/scc-test.hexfloat.cpp @@ -5,7 +5,7 @@ @(#)Purpose: Hexadecimal floating point constants (C99 and later) @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2016 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ // There is evidence from G++ 6.1.0 that C++17 (C++1z) will support diff --git a/scc-test.numpunct.cpp b/scc-test.numpunct.cpp index ee5838e..65802aa 100644 --- a/scc-test.numpunct.cpp +++ b/scc-test.numpunct.cpp @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on numbers with C++14 punctuation @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2014-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ float f1 = 0x12'34'45p-12; diff --git a/scc-test.rawstring.cpp b/scc-test.rawstring.cpp index 9ca20f5..f0e011f 100644 --- a/scc-test.rawstring.cpp +++ b/scc-test.rawstring.cpp @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on C++11 raw strings @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2014-15 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /*TABSTOP=4*/ diff --git a/scc-test.ucns.c b/scc-test.ucns.c index 5ee50b5..2a0b5e6 100644 --- a/scc-test.ucns.c +++ b/scc-test.ucns.c @@ -5,7 +5,7 @@ @(#)Purpose: Test SCC on Unicode extended identifiers @(#)Author: J Leffler @(#)Copyright: (C) JLSS 2014,2016 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Product: SCC Version 6.70 (2017-10-17) */ /* diff --git a/scc.1 b/scc.1 index 55d2b61..6d69ee0 100644 --- a/scc.1 +++ b/scc.1 @@ -1,11 +1,11 @@ -.\" @(#)$Id: scc.1,v 1.4 2016/05/23 03:46:16 jleffler Exp $ +.\" @(#)$Id: scc.1,v 1.6 2017/10/18 06:47:32 jleffler Exp $ .\" @(#)Manual page: SCC - Strip C Comments -.ds fC "Version: $Revision: 1.4 $ ($Date: 2016/05/23 03:46:16 $) +.ds fC "Version: $Revision: 1.6 $ ($Date: 2017/10/18 06:47:32 $) .TH SCC 1S "JLSS UNIX Tools" .SH NAME scc \(em Strip C comments from source code .SH SYNOPSIS -\fBscc\fP [-cfhnwV][-S std][-s rep][-q rep] [file ...] +\fBscc\fP [-cefhnwV][-S std][-s rep][-q rep] [file ...] .SH DESCRIPTION The \fBscc\fP program strips comments from C and C++ source code. By default, it assumes the code is C11 and therefore eliminates both @@ -23,6 +23,9 @@ The `\*c-c\*d' option prints comments and not the code. The `\*c-n\*d' option keeps newlines in comments, so the input and output line counts should be the same, even though comments were stripped. +The `\*c-e\*d' option prints an empty comment (omitting the text of +the comment) rather than deleting it altogether, so it does not apply +when the `\*c-c\*d' option is used. .P The `\*c-s rep\*d' option replaces the body of string literals with the single character specified by `\*crep\*d', which can simplify some forms @@ -72,9 +75,12 @@ There are some ghastly possible behaviours related to `\*c/*\*d' or `\*c//\*d' sequences in association with `\*c#include\*d' directives. Once again, these are more theoretical than practical, and SCC currently does not detect or handle them. +.SH VERSION +Documentation for +SCC Version 6.70 (2017-10-17) Version 6.70 (2017-10-17) .SH AUTHOR Jonathan Leffler .br JLSS .br -22nd May 2016 +12th June 2016 diff --git a/scc.c b/scc.c index 3aaa898..2285ae1 100644 --- a/scc.c +++ b/scc.c @@ -1,10 +1,10 @@ /* @(#)File: $RCSfile: scc.c,v $ -@(#)Version: $Revision: 6.31 $ -@(#)Last changed: $Date: 2016/06/13 04:34:04 $ +@(#)Version: $Revision: 6.35 $ +@(#)Last changed: $Date: 2017/10/18 06:39:47 $ @(#)Purpose: Strip C comments @(#)Author: J Leffler -@(#)Copyright: (C) JLSS 1991,1993,1997-98,2003,2005,2007-08,2011-12,2014-16 +@(#)Copyright: (C) JLSS 1991-2017 */ /*TABSTOP=4*/ @@ -72,7 +72,6 @@ #include #include #include -#include #include #include @@ -104,6 +103,18 @@ static const char std_name[][6] = }; enum { NUM_STDNAMES = sizeof(std_name) / sizeof(std_name[0]) }; +enum Feature { F_HEXFLOAT, F_RAWSTRING, F_DOUBLESLASH, F_UNICODE, F_BINARY, F_NUMPUNCT, F_UNIVERSAL }; +static const char *feature_name[] = +{ + [F_HEXFLOAT] = "Hexadecimal floating point constant", + [F_RAWSTRING] = "Raw string", + [F_DOUBLESLASH] = "Double slash comment", + [F_UNICODE] = "Unicode character or string", + [F_BINARY] = "Binary literal", + [F_NUMPUNCT] = "Numeric punctuation", + [F_UNIVERSAL] = "Universal character name", +}; + static const char * const dq_reg_prefix[] = { "L", "u", "U", "u8", }; static const char * const dq_raw_prefix[] = { "R", "LR", "uR", "UR", "u8R" }; enum { NUM_DQ_REG_PREFIX = sizeof(dq_reg_prefix) / sizeof(dq_reg_prefix[0]) }; @@ -111,11 +122,13 @@ enum { NUM_DQ_RAW_PREFIX = sizeof(dq_raw_prefix) / sizeof(dq_raw_prefix[0]) }; static int std_code = C11; /* Selected standard */ -static int cflag = 0; /* Print comments and not code */ -static int nflag = 0; /* Keep newlines in comments */ +static bool cflag = false; /* Print comments and not code */ +static bool eflag = false; /* Print empty comment instead of blank */ +static bool nflag = false; /* Keep newlines in comments */ +static bool wflag = false; /* Warn about nested C-style comments */ + static int qchar = 0; /* Replacement character for quotes */ static int schar = 0; /* Replacement character for strings */ -static int wflag = 0; /* Warn about nested C-style comments */ /* Features recognized */ static bool f_DoubleSlash = false; /* // comments */ @@ -124,16 +137,18 @@ static bool f_Unicode = false; /* Unicode strings (u\"A\", U\"A\", u8\"A\") static bool f_Binary = false; /* Binary constants 0b0101 */ static bool f_HexFloat = false; /* Hexadecimal floats 0x2.34P-12 */ static bool f_NumPunct = false; /* Numeric punctuation 0x1234'5678 */ -static bool f_UniversalCharNames = false; /* Universal character names \uXXXX and \Uxxxxxxxx */ +static bool f_Universal = false; /* Universal character names \uXXXX and \Uxxxxxxxx */ static int nline = 0; /* Line counter */ static int l_nest = 0; /* Last line with a nested comment warning */ static int l_cend = 0; /* Last line with a comment end warning */ +static bool l_comment = false; /* Line contained a comment - print newline in -c mode */ -static const char optstr[] = "cfhnq:s:wS:V"; -static const char usestr[] = "[-cfhnwV][-S std][-s rep][-q rep] [file ...]"; +static const char optstr[] = "cefhnq:s:wS:V"; +static const char usestr[] = "[-cefhnwV][-S std][-s rep][-q rep] [file ...]"; static const char hlpstr[] = " -c Print comments and not the code\n" + " -e Print empty comment /* */ or //\n" " -f Print flags in effect (debugging mainly)\n" " -h Print this help and exit\n" " -n Keep newlines in comments\n" @@ -151,7 +166,7 @@ static Comment non_comment(int c, FILE *fp, const char *fn); #ifndef lint /* Prevent over-aggressive optimizers from eliminating ID string */ extern const char jlss_id_scc_c[]; -const char jlss_id_scc_c[] = "@(#)$Id: scc.c,v 6.31 2016/06/13 04:34:04 jleffler Exp $"; +const char jlss_id_scc_c[] = "@(#)$Id: scc.c,v 6.35 2017/10/18 06:39:47 jleffler Exp $"; #endif /* lint */ static int getch(FILE *fp) @@ -181,8 +196,10 @@ static int peek(FILE *fp) /* Put source code character */ static void s_putch(char c) { - if (!cflag || (nflag && c == '\n')) + if (!cflag || ((nflag || l_comment) && c == '\n')) putchar(c); + if (c == '\n') + l_comment = false; } /* Put comment (non-code) character */ @@ -220,47 +237,11 @@ static void warningv(const char *fmt, const char *file, int line, ...) warning(buffer, file, line); } -/* The warn_XxxYyy() functions are crying out for refactoring */ -static void warn_HexFloat(const char *fn) +static void warn_feature(enum Feature feature, const char *fn) { assert(fn != 0); - warning2("Hexadecimal floating point constant used but not supported in", std_name[std_code], fn, nline); -} - -static void warn_RawString(const char *fn) -{ - assert(fn != 0); - warning2("Raw string used but not supported in", std_name[std_code], fn, nline); -} - -static void warn_DoubleSlash(const char *fn) -{ - assert(fn != 0); - warning2("Double slash comment used but not supported in", std_name[std_code], fn, nline); -} - -static void warn_Unicode(const char *fn) -{ - assert(fn != 0); - warning2("Unicode feature used but not supported in", std_name[std_code], fn, nline); -} - -static void warn_Binary(const char *fn) -{ - assert(fn != 0); - warning2("Binary literal feature used but not supported in", std_name[std_code], fn, nline); -} - -static inline void warn_NumPunct(const char *fn) -{ - assert(fn != 0); - warning2("Numeric punctuation feature used but not supported in", std_name[std_code], fn, nline); -} - -static inline void warn_UniversalCharNames(const char *fn) -{ - assert(fn != 0); - warning2("Universal character names feature used but not supported in", std_name[std_code], fn, nline); + assert(feature >= F_HEXFLOAT && feature <= F_UNIVERSAL); + warningv("%s feature used but not supported in %s", fn, nline, feature_name[feature], std_name[std_code]); } static void put_quote_char(char q, char c) @@ -292,8 +273,8 @@ static void endquote(char q, FILE *fp, const char *fn, const char *msg) if ((c = getch(fp)) == EOF) break; put_quote_char(q, c); - if ((c == 'u' || c == 'U') && !f_UniversalCharNames) - warn_UniversalCharNames(fn); + if ((c == 'u' || c == 'U') && !f_Universal) + warn_feature(F_UNIVERSAL, fn); if (c == '\\' && peek(fp) == '\n') s_putch(getch(fp)); } @@ -357,12 +338,18 @@ static Comment c_comment(int c, FILE *fp, const char *fn) int bsnl = read_bsnl(fp); if (peek(fp) == '/') { + l_comment = true; status = NonComment; c = getch(fp); c_putch('*'); write_bsnl(bsnl, c_putch); c_putch('/'); s_putch(' '); + if (eflag) + { + s_putch('*'); + s_putch('/'); + } } else { @@ -389,6 +376,8 @@ static Comment cpp_comment(int c, int oc) { status = NonComment; s_putch(c); + if (!nflag) + c_putch(c); } else c_putch(c); @@ -409,8 +398,8 @@ static void scan_ucn(int letter, int nbytes, FILE *fp, const char *fn) bool ok = true; int i; char str[8]; - if (!f_UniversalCharNames) - warn_UniversalCharNames(fn); + if (!f_Universal) + warn_feature(F_UNIVERSAL, fn); s_putch('\\'); int c = getch(fp); assert(c == letter); @@ -464,7 +453,7 @@ static int check_punct(int oc, FILE *fp, const char *fn, int (*digit_check)(int assert(sq == '\''); s_putch(sq); if (!f_NumPunct) - warn_NumPunct(fn); + warn_feature(F_NUMPUNCT, fn); if (!(*digit_check)(oc)) { warning("Single quote in numeric context not preceded by a valid digit", fn, nline); @@ -525,7 +514,7 @@ static void parse_hex(FILE *fp, const char *fn) if (pc == '.' && !f_HexFloat) { if (!warned) - warn_HexFloat(fn); + warn_feature(F_HEXFLOAT, fn); warned = true; } oc = pc; @@ -535,7 +524,7 @@ static void parse_hex(FILE *fp, const char *fn) if (pc == 'p' || pc == 'P') { if (!f_HexFloat && !warned) - warn_HexFloat(fn); + warn_feature(F_HEXFLOAT, fn); parse_exponent(fp, fn); } } @@ -545,7 +534,7 @@ static void parse_binary(FILE *fp, const char *fn) /* Binary constant - integer */ /* Should be followed by one or more binary digits */ if (!f_Binary) - warn_Binary(fn); + warn_feature(F_BINARY, fn); s_putch('0'); /* 0 */ int c = getch(fp); assert(c == 'b' || c == 'B'); @@ -871,14 +860,14 @@ static void parse_dq_string(const char *prefix, FILE *fp, const char *fn) if (valid_dq_raw_prefix(prefix)) { if (!f_RawString) - warn_RawString(fn); + warn_feature(F_RAWSTRING, fn); s_putstr(prefix); parse_raw_string(prefix, fp, fn); } else { if (strcmp(prefix, "L") != 0 && !f_Unicode) - warn_Unicode(fn); + warn_feature(F_UNICODE, fn); s_putstr(prefix); (void)non_comment('"', fp, fn); } @@ -968,7 +957,7 @@ static Comment non_comment(int c, FILE *fp, const char *fn) { int pc; Comment status = NonComment; - if (c == '*' && wflag == 1 && peek(fp) == '/') + if (c == '*' && peek(fp) == '/') { /* NB: does not detect star backslash newline slash as stray end of comment */ if (l_cend != nline) @@ -1009,10 +998,15 @@ static Comment non_comment(int c, FILE *fp, const char *fn) c_putch('/'); write_bsnl(bsnl, c_putch); c_putch('*'); + if (eflag) + { + s_putch('/'); + s_putch('*'); + } } else if (!f_DoubleSlash && pc == '/') { - warn_DoubleSlash(fn); + warn_feature(F_DOUBLESLASH, fn); c = getch(fp); s_putch(c); write_bsnl(bsnl, s_putch); @@ -1025,6 +1019,11 @@ static Comment non_comment(int c, FILE *fp, const char *fn) c_putch(c); write_bsnl(bsnl, c_putch); c_putch(c); + if (eflag) + { + s_putch('/'); + s_putch('/'); + } } else { @@ -1106,7 +1105,7 @@ static void set_features(int code) /*FALLTHROUGH*/ case C99: f_HexFloat = true; - f_UniversalCharNames = true; + f_Universal = true; f_DoubleSlash = true; break; case CXX17: @@ -1123,7 +1122,7 @@ static void set_features(int code) /*FALLTHROUGH*/ case CXX98: case CXX03: - f_UniversalCharNames = true; + f_Universal = true; f_DoubleSlash = true; break; default: @@ -1136,9 +1135,9 @@ static void print_features(int code) { printf("Standard: %s\n", std_name[code]); if (f_DoubleSlash) - printf("Feature: // comments\n"); + printf("Feature: Double slash comments // to EOL\n"); if (f_RawString) - printf("Feature: Raw strings\n"); + printf("Feature: Raw strings R\"ZZ(string)ZZ\"\n"); if (f_Unicode) printf("Feature: Unicode strings (u\"A\", U\"A\", u8\"A\")\n"); if (f_Binary) @@ -1147,7 +1146,7 @@ static void print_features(int code) printf("Feature: Hexadecimal floats 0x2.34P-12\n"); if (f_NumPunct) printf("Feature: Numeric punctuation 0x1234'5678\n"); - if (f_UniversalCharNames) + if (f_Universal) printf("Feature: Universal character names \\uXXXX and \\Uxxxxxxxx\n"); } @@ -1163,7 +1162,10 @@ int main(int argc, char **argv) switch (opt) { case 'c': - cflag = 1; + cflag = true; + break; + case 'e': + eflag = true; break; case 'f': fflag = true; @@ -1172,7 +1174,7 @@ int main(int argc, char **argv) err_help(usestr, hlpstr); break; case 'n': - nflag = 1; + nflag = true; break; case 'q': qchar = *optarg; @@ -1181,13 +1183,13 @@ int main(int argc, char **argv) schar = *optarg; break; case 'w': - wflag = 1; + wflag = true; break; case 'S': std_code = parse_std_arg(optarg); break; case 'V': - err_version("SCC", &"@(#)6.60 (2016-06-12)"[4]); + err_version("SCC", &"@(#)6.70 (2017-10-17)"[4]); break; default: err_usage(usestr); diff --git a/scc.test-01.sh b/scc.test-01.sh index 34c112e..ae9e410 100644 --- a/scc.test-01.sh +++ b/scc.test-01.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# @(#)$Id: scc.test-01.sh,v 1.8 2016/06/10 04:37:06 jleffler Exp $ +# @(#)$Id: scc.test-01.sh,v 1.9 2016/06/13 05:44:58 jleffler Exp $ # # Test driver for SCC - comparing with reference version (SCC 5.05) @@ -77,8 +77,8 @@ do # Old SCC is run as scc-5.05; normalize error messages from new SCC # to use that name too (to simplify comparisons). sed -e 's/:63:/:64:/' \ - -e '/Double slash comment used/d' \ - -e '/Universal character names feature/d' \ + -e '/Double slash comment feature used/d' \ + -e '/Universal character name feature used/d' \ -e "s/^$T_BASE:/$R_BASE:/" \ $tmp.4 > $tmp.5 if [ -s $tmp.1 ] && [ -s $tmp.2 ] && cmp -s $tmp.1 $tmp.2 && diff --git a/scc.test-04.sh b/scc.test-04.sh index 75217c9..b5b9675 100644 --- a/scc.test-04.sh +++ b/scc.test-04.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# @(#)$Id: scc.test-04.sh,v 1.3 2016/06/01 06:33:06 jleffler Exp $ +# @(#)$Id: scc.test-04.sh,v 1.4 2016/06/13 05:45:22 jleffler Exp $ # # Test driver for SCC: -S C++14 and binary numbers, numeric punctuation @@ -66,7 +66,12 @@ do diff "$tmp.2" "$EXPERR" test=1 fi - if [ $test = 0 ] + if [ "$gflag" = yes ] + then + echo "== GENERATED == ($standard: $base.c)" + echo " ($EXPOUT $EXPERR)" + : $((pass++)) + elif [ $test = 0 ] then echo "== PASS == ($base.cpp)" : $((pass++)) diff --git a/scc.test-05.sh b/scc.test-05.sh index 80a0341..7868a1f 100644 --- a/scc.test-05.sh +++ b/scc.test-05.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# @(#)$Id: scc.test-05.sh,v 1.3 2016/06/10 04:27:45 jleffler Exp $ +# @(#)$Id: scc.test-05.sh,v 1.4 2016/06/13 05:45:22 jleffler Exp $ # # Test driver for SCC: Handling of Unicode characters and strings @@ -68,16 +68,18 @@ do diff "$tmp.2" "$EXPERR" test=1 fi - if [ "$gflag" = no ] + if [ "$gflag" = yes ] + then + echo "== GENERATED == ($standard: $base.c)" + echo " ($EXPOUT $EXPERR)" + : $((pass++)) + elif [ $test = 0 ] then - if [ $test = 0 ] - then - echo "== PASS == ($standard: $base.c)" - : $((pass++)) - else - echo "!! FAIL !! ($standard: $base.c)" - : $((fail++)) - fi + echo "== PASS == ($standard: $base.c)" + : $((pass++)) + else + echo "!! FAIL !! ($standard: $base.c)" + : $((fail++)) fi rm -f "$tmp".? done diff --git a/scc.test-06.sh b/scc.test-06.sh index 4a3c8d2..b64fb50 100644 --- a/scc.test-06.sh +++ b/scc.test-06.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# @(#)$Id: scc.test-06.sh,v 1.2 2016/05/22 20:52:24 jleffler Exp $ +# @(#)$Id: scc.test-06.sh,v 1.3 2016/06/13 05:45:22 jleffler Exp $ # # Test driver for SCC: using -c, -n in combination # @@ -71,16 +71,18 @@ do diff "$tmp.2" "$EXPERR" test=1 fi - if [ "$gflag" = no ] + if [ "$gflag" = yes ] + then + echo "== GENERATED == ($standard: $base.c)" + echo " ($EXPOUT $EXPERR)" + : $((pass++)) + elif [ $test = 0 ] then - if [ $test = 0 ] - then - echo "== PASS == ($standard: ${args:+$args }$base.c)" - : $((pass++)) - else - echo "!! FAIL !! ($standard: ${args:+$args }$base.c)" - : $((fail++)) - fi + echo "== PASS == ($standard: ${args:+$args }$base.c)" + : $((pass++)) + else + echo "!! FAIL !! ($standard: ${args:+$args }$base.c)" + : $((fail++)) fi rm -f "$tmp".? done diff --git a/scc.test-08.sh b/scc.test-08.sh new file mode 100644 index 0000000..0437718 --- /dev/null +++ b/scc.test-08.sh @@ -0,0 +1,94 @@ +#!/bin/ksh +# +# @(#)$Id: scc.test-08.sh,v 1.1 2017/10/18 05:49:53 jleffler Exp $ +# +# Test driver for SCC: Printing empty comments + +T_SCC=./scc # Version of SCC under test +RCSKW="${RCSKWREDUCE:-rcskwreduce}" + +[ -x "$T_SCC" ] || ${MAKE:-make} "$T_SCC" || exit 1 + +arg0=$(basename "$0" .sh) + +usage() +{ + echo "Usage: $arg0 [-gq]" >&2 + exit 1 +} + +# -g Generate result files +# -q Quiet mode + +qflag=no +gflag=no +while getopts gq opt +do + case "$opt" in + (q) qflag=yes;; + (g) gflag=yes;; + (*) usage;; + esac +done +shift $((OPTIND - 1)) +[ "$#" = 0 ] || usage + +tmp=${TMPDIR:-/tmp}/scc-test +trap "rm -f $tmp.?; exit 1" 0 1 2 3 13 15 + +OUTPUT_DIR=Output +SOURCE=scc-test.example2.c +base="$arg0.example2" + +{ +suffix=".c" +fail=0 +pass=0 +# Don't quote file name or options - spaces need trimming +for options in "-e" "-en" "-ec" +do + test=0 + "$T_SCC" "$options" "${SOURCE}" > "$tmp.1" 2> "$tmp.2" + EXPOUT="$OUTPUT_DIR/$base$options.1" + EXPERR="$OUTPUT_DIR/$base$options.2" + if [ "$gflag" = yes ] + then cp "$tmp.1" "$EXPOUT" + elif cmp -s <($RCSKW "$tmp.1") <($RCSKW "$EXPOUT") + then : OK + else + echo "Differences: $SOURCE - standard output" + diff "$tmp.1" "$EXPOUT" + test=1 + fi + if [ "$gflag" = yes ] + then cp "$tmp.2" "$EXPERR" + elif cmp -s <($RCSKW "$tmp.2") <($RCSKW "$EXPERR") + then : OK + else + echo "Differences: $SOURCE - standard error" + diff "$tmp.2" "$EXPERR" + test=1 + fi + if [ "$gflag" = yes ] + then + echo "== GENERATED == ($options: $SOURCE)" + echo " ($EXPOUT $EXPERR)" + : $((pass++)) + elif [ $test = 0 ] + then + echo "== PASS == ($options: $SOURCE)" + : $((pass++)) + else + echo "!! FAIL !! ($options: $SOURCE)" + : $((fail++)) + fi + rm -f "$tmp".? +done +if [ $fail = 0 ] +then echo "== PASS == ($pass tests OK)" +else echo "!! FAIL !! ($pass tests OK, $fail tests failed)" +fi +} + +rm -f $tmp.? +trap 0 diff --git a/stderr.c b/stderr.c index f19af0b..63d816e 100644 --- a/stderr.c +++ b/stderr.c @@ -1,11 +1,11 @@ /* @(#)File: $RCSfile: stderr.c,v $ -@(#)Version: $Revision: 10.14 $ -@(#)Last changed: $Date: 2015/06/02 03:04:32 $ +@(#)Version: $Revision: 10.19 $ +@(#)Last changed: $Date: 2017/07/10 04:54:26 $ @(#)Purpose: Error reporting routines @(#)Author: J Leffler -@(#)Copyright: (C) JLSS 1988-91,1996-99,2001,2003,2005-11,2013,2015 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Copyright: (C) JLSS 1988-2017 +@(#)Product: SCC Version 6.70 (2017-10-17) */ /*TABSTOP=4*/ @@ -15,6 +15,12 @@ ** USE_STDERR_SYSLOG - include syslog functionality ** USE_STDERR_FILEDESC - include file descriptor functionality ** JLSS_STDERR - force support for syslog and file descriptors +** +** HAVE_UNISTD_H +** HAVE_CLOCK_GETTIME +** HAVE_GETTIMEOFDAY +** HAVE_SYSLOG_H +** HAVE_SYSLOG */ #include "posixver.h" @@ -33,13 +39,17 @@ extern int getpid(void); #endif /* HAVE_UNISTD_H */ -enum { MAX_MSGLEN = 2048 }; +#ifndef ERR_MAXMSGLEN +#define ERR_MAXMSGLEN 2048 +#endif +enum { MAX_MSGLEN = ERR_MAXMSGLEN }; /* Find sub-second timing mechanism */ #if defined(HAVE_CLOCK_GETTIME) /* Uses */ #elif defined(HAVE_GETTIMEOFDAY) -/* Mac OS X 10.10.3 does not have clock_gettime() yet */ +/* Mac OS X up to version 10.11 does not have clock_gettime() */ +/* macOS Sierra 10.12 and up does have clock_gettime() */ #include #else /* No sub-second timing */ @@ -109,7 +119,7 @@ static NORETURN void err_terminate(int flags, int estat); #ifndef lint /* Prevent over-aggressive optimizers from eliminating ID string */ extern const char jlss_id_stderr_c[]; -const char jlss_id_stderr_c[] = "@(#)$Id: stderr.c,v 10.14 2015/06/02 03:04:32 jleffler Exp $"; +const char jlss_id_stderr_c[] = "@(#)$Id: stderr.c,v 10.19 2017/07/10 04:54:26 jleffler Exp $"; #endif /* lint */ /* @@ -129,6 +139,23 @@ int err_getlogopts(void) return(err_flags); } +/* Set time format - NULL implies default format */ +const char *err_settimeformat(const char *new_fmt) +{ + const char *old_fmt = tm_format; + if (new_fmt == NULL) + tm_format = def_format; + else + tm_format = new_fmt; + return old_fmt; +} + +/* Set time format - NULL implies default format */ +const char *err_gettimeformat(void) +{ + return tm_format; +} + /* Change the definition of 'stderr', reporting on the old one too */ /* NB: using err_stderr((FILE *)0) simply reports the current 'stderr' */ FILE *(err_stderr)(FILE *newerr) @@ -199,7 +226,7 @@ const char *(err_getarg0)(void) void (err_setarg0)(const char *argv0) { /* Ignore three pathological program names -- NULL, "/" and "" */ - if (argv0 != 0 && *argv0 != '\0' && (*argv0 != '/' || *(argv0 + 1) != '\0')) + if (argv0 != 0 && *argv0 != '\0' && (argv0[0] != '/' || argv0[1] != '\0')) { const char *cp; size_t nbytes = sizeof(arg0) - 1; @@ -230,7 +257,11 @@ void (err_setarg0)(const char *argv0) if (nbytes > sizeof(arg0) - 1) nbytes = sizeof(arg0) - 1; } - strncpy(arg0, cp, nbytes); + /* + ** Use memmove() to allow for usage: daemonize(err_getarg(), 0); + ** where daemonize() calls err_setarg0() with its first argument. + */ + memmove(arg0, cp, nbytes); arg0[nbytes] = '\0'; } } @@ -243,7 +274,7 @@ const char *(err_rcs_string)(const char *s2, char *buffer, size_t buflen) /* ** Bother RCS! We've probably been given something like: - ** "$Revision: 10.14 $ ($Date: 2015/06/02 03:04:32 $)" + ** "$Revision: 10.19 $ ($Date: 2017/07/10 04:54:26 $)" ** We only want to emit "7.5 (2001/08/11 06:25:48)". ** Skip the components between '$' and ': ', copy up to ' $', ** repeating as necessary. And we have to test for overflow! @@ -333,50 +364,26 @@ static char *err_time(int flags, char *buffer, size_t buflen) if (flags & (ERR_NANO | ERR_MICRO | ERR_MILLI)) { char subsec[12]; - size_t ss_len; + int ss_len; if (flags & ERR_NANO) ss_len = snprintf(subsec, sizeof(subsec), ".%.9ld", clk.tv_nsec); else if (flags & ERR_MICRO) ss_len = snprintf(subsec, sizeof(subsec), ".%.6ld", clk.tv_nsec / 1000); else /* (flags & ERR_MILLI) */ ss_len = snprintf(subsec, sizeof(subsec), ".%.3ld", clk.tv_nsec / (1000 * 1000)); - if (ss_len + nb + 1 < buflen) + if (ss_len > 0 && (size_t)ss_len + nb + 1 < buflen) strcpy(buffer + nb, subsec); } return(buffer); } -/* err_stdio - report error via stdio */ -static void (err_stdio)(FILE *fp, int flags, int errnum, const char *format, va_list args) -{ - if ((flags & ERR_NOARG0) == 0) - fprintf(fp, "%s: ", arg0); - if (flags & ERR_LOGTIME) - { - char timbuf[48]; - fprintf(fp, "%s - ", err_time(flags, timbuf, sizeof(timbuf))); - } - if (flags & ERR_PID) - fprintf(fp, "pid=%d: ", (int)getpid()); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" - vfprintf(fp, format, args); -#pragma GCC diagnostic pop - if (flags & ERR_ERRNO) - fprintf(fp, "error (%d) %s\n", errnum, strerror(errnum)); -} - -#if defined(USE_STDERR_FILEDESC) || defined(USE_STDERR_SYSLOG) static char *fmt_string(char *curr, const char *end, const char *format, va_list args) { char *new_end = curr; if (curr < end - 1) { size_t size = (size_t)(end - curr); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" int more = vsnprintf(curr, size, format, args); -#pragma GCC diagnostic pop if (more >= 0) new_end += ((size_t)more >= size) ? size : (size_t)more; } @@ -392,24 +399,60 @@ static char *fmt_strdots(char *curr, const char *end, const char *format, ...) va_end(args); return new_end; } -#endif /* USE_STDERR_FILEDESC || USE_STDERR_SYSLOG */ + +static size_t err_fmtmsg(char *buffer, size_t buflen, int flags, int errnum, const char *format, va_list args) +{ + char *curpos = buffer; + char *bufend = buffer + buflen; + + buffer[0] = '\0'; /* Not strictly necessary */ + if ((flags & ERR_NOARG0) == 0) + curpos = fmt_strdots(curpos, bufend, "%s: ", arg0); + if (flags & ERR_LOGTIME) + { + char timbuf[32]; + curpos = fmt_strdots(curpos, bufend, + "%s - ", err_time(flags, timbuf, sizeof(timbuf))); + } + if (flags & ERR_PID) + curpos = fmt_strdots(curpos, bufend, + "pid=%d: ", (int)getpid()); + curpos = fmt_string(curpos, bufend, format, args); + if (flags & ERR_ERRNO) + curpos = fmt_strdots(curpos, bufend, + "error (%d) %s\n", errnum, strerror(errnum)); + assert(curpos >= buffer); + return((size_t)(curpos - buffer)); +} + +/* +** err_stdio - report error via stdio +** Using fflush(fp) ensures that the message is flushed even if the +** stream is fully buffered. +** No longer need explicit flockfile() and funlockfile() because there's +** only a single call to fprintf() and that must lock the stream anyway. +*/ +static void (err_stdio)(FILE *fp, int flags, int errnum, const char *format, va_list args) +{ + char buffer[MAX_MSGLEN]; + err_fmtmsg(buffer, sizeof(buffer), flags, errnum, format, args); + fprintf(fp, "%s", buffer); + fflush(fp); +} #if defined(USE_STDERR_SYSLOG) /* err_syslog() - report error via syslog ** -** syslog() automatically adds PID and program name (configured in openlog()) and time stamp. +** syslog() automatically adds PID and program name (configured in +** openlog()) and time stamp. Hence those elements are removed from +** flags sent to err_fmtmsg. */ static void (err_syslog)(int flags, int errnum, const char *format, va_list args) { char buffer[MAX_MSGLEN]; - char *curpos = buffer; - char *bufend = buffer + sizeof(buffer); int priority; - curpos = fmt_string(curpos, bufend, format, args); - if (flags & ERR_ERRNO) - curpos = fmt_strdots(curpos, bufend, - "error (%d) %s\n", errnum, strerror(errnum)); + err_fmtmsg(buffer, sizeof(buffer), flags & ~(ERR_NOARG0|ERR_PID|ERR_LOGTIME), errnum, format, args); if (flags & ERR_ABORT) priority = LOG_CRIT; @@ -426,29 +469,19 @@ static void (err_syslog)(int flags, int errnum, const char *format, va_list args static void (err_filedes)(int fd, int flags, int errnum, const char *format, va_list args) { char buffer[MAX_MSGLEN]; - char *curpos = buffer; - char *bufend = buffer + sizeof(buffer); + size_t msglen = err_fmtmsg(buffer, sizeof(buffer), flags, errnum, format, args); ssize_t nbytes; + char *msgbuf = buffer; - buffer[0] = '\0'; /* Not strictly necessary */ - if ((flags & ERR_NOARG0) == 0) - curpos = fmt_strdots(curpos, bufend, "%s: ", arg0); - if (flags & ERR_LOGTIME) + while (msglen > 0) { - char timbuf[32]; - curpos = fmt_strdots(curpos, bufend, - "%s - ", err_time(flags, timbuf, sizeof(timbuf))); + nbytes = write(fd, msgbuf, msglen); + if (nbytes <= 0) + break; + msgbuf += nbytes; + assert(nbytes > 0 && msglen >= (size_t)nbytes); + msglen -= (size_t)nbytes; } - if (flags & ERR_PID) - curpos = fmt_strdots(curpos, bufend, - "pid=%d: ", (int)getpid()); - curpos = fmt_string(curpos, bufend, format, args); - if (flags & ERR_ERRNO) - curpos = fmt_strdots(curpos, bufend, - "error (%d) %s\n", errnum, strerror(errnum)); - /* There's no sensible way to handle short writes! */ - nbytes = write(fd, buffer, (size_t)(curpos - buffer)); - assert(nbytes == curpos - buffer); } #endif /* USE_STDERR_FILEDESC */ @@ -678,7 +711,5 @@ void (err_internal)(const char *function, const char *format, ...) } #ifdef TEST - -#error Use separate test program test.stderr.c - +#include "test.stderr.c" #endif /* TEST */ diff --git a/stderr.h b/stderr.h index 441eabc..c69c35c 100644 --- a/stderr.h +++ b/stderr.h @@ -1,11 +1,11 @@ /* @(#)File: $RCSfile: stderr.h,v $ -@(#)Version: $Revision: 10.10 $ -@(#)Last changed: $Date: 2015/10/14 23:12:19 $ +@(#)Version: $Revision: 10.12 $ +@(#)Last changed: $Date: 2017/04/08 03:43:34 $ @(#)Purpose: Header file for standard error functions @(#)Author: J Leffler -@(#)Copyright: (C) JLSS 1989-93,1996-99,2003,2005-11,2015 -@(#)Product: SCC Version 6.60 (2016-06-12) +@(#)Copyright: (C) JLSS 1989-2017 +@(#)Product: SCC Version 6.70 (2017-10-17) */ #if !defined(STDERR_H) @@ -15,7 +15,7 @@ #if !defined(lint) /* Prevent over-aggressive optimizers from eliminating ID string */ extern const char jlss_id_stderr_h[]; -const char jlss_id_stderr_h[] = "@(#)$Id: stderr.h,v 10.10 2015/10/14 23:12:19 jleffler Exp $"; +const char jlss_id_stderr_h[] = "@(#)$Id: stderr.h,v 10.12 2017/04/08 03:43:34 jleffler Exp $"; #endif /* lint */ #endif @@ -45,6 +45,14 @@ const char jlss_id_stderr_h[] = "@(#)$Id: stderr.h,v 10.10 2015/10/14 23:12:19 j #endif /* __STDC_VERSION__ || __GNUC__ */ #endif /* NORETURN */ +#if !defined(DEPRECATED) +#if defined(__GNUC__) +#define DEPRECATED __attribute__((deprecated)) +#else +#define DEPRECATED /* If only */ +#endif /* __GNUC__ */ +#endif /* DEPRECATED */ + #if !defined(PRINTFLIKE) #if defined(__GNUC__) #define PRINTFLIKE(n,m) __attribute__((format(printf,n,m))) @@ -107,14 +115,14 @@ extern const char *err_rcs_string(const char *s, char *buffer, size_t buflen); extern NORETURN void err_abort(const char *format, ...) PRINTFLIKE(1,2); extern NORETURN void err_error(const char *format, ...) PRINTFLIKE(1,2); -extern NORETURN void err_error1(const char *s1); -extern NORETURN void err_error2(const char *s1, const char *s2); +extern NORETURN void err_error1(const char *s1) DEPRECATED; /* err_error() */ +extern NORETURN void err_error2(const char *s1, const char *s2) DEPRECATED; /* err_error() */ extern NORETURN void err_help(const char *use_str, const char *hlp_str); extern NORETURN void err_helplist(const char *use_str, const char * const *help_list); extern NORETURN void err_internal(const char *function, const char *format, ...) PRINTFLIKE(2,3); extern NORETURN void err_syserr(const char *format, ...) PRINTFLIKE(1,2); -extern NORETURN void err_syserr1(const char *s1); -extern NORETURN void err_syserr2(const char *s1, const char *s2); +extern NORETURN void err_syserr1(const char *s1) DEPRECATED; /* err_syserr() */ +extern NORETURN void err_syserr2(const char *s1, const char *s2) DEPRECATED; /* err_syserr() */ extern NORETURN void err_syserror(int errnum, const char *format, ...) PRINTFLIKE(2,3); extern NORETURN void err_usage(const char *usestr); extern NORETURN void err_version(const char *program, const char *verinfo); @@ -123,17 +131,21 @@ extern void err_logmsg(FILE *fp, int flags, int estat, const char *format, ...) extern void err_print(int flags, int estat, const char *format, va_list args); extern void err_printversion(const char *program, const char *verinfo); extern void err_remark(const char *format, ...) PRINTFLIKE(1,2); -extern void err_remark1(const char *s1); -extern void err_remark2(const char *s1, const char *s2); +extern void err_remark1(const char *s1) DEPRECATED; /* err_remark() */ +extern void err_remark2(const char *s1, const char *s2) DEPRECATED; /* err_remark() */ extern void err_report(int flags, int estat, const char *format, ...) PRINTFLIKE(3,4); extern void err_sysrem(const char *format, ...) PRINTFLIKE(1,2); -extern void err_sysrem1(const char *s1); -extern void err_sysrem2(const char *s1, const char *s2); +extern void err_sysrem1(const char *s1) DEPRECATED; /* err_sysrem() */ +extern void err_sysrem2(const char *s1, const char *s2) DEPRECATED; /* err_sysrem() */ extern void err_sysremark(int errnum, const char *format, ...) PRINTFLIKE(2,3); extern int err_getlogopts(void); /* Get default log options */ extern int err_setlogopts(int new_opts); /* Set default log options */ +/* Time format of NULL sets default format - returns previous format */ +extern const char *err_settimeformat(const char *new_fmt); +extern const char *err_gettimeformat(void); + #if defined(USE_STDERR_FILEDESC) extern int err_use_fd(int fd); /* Use file descriptor */ #endif /* USE_STDERR_FILEDESC */