[ 
https://issues.apache.org/jira/browse/DAFFODIL-2566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17432966#comment-17432966
 ] 

Dave Thompson commented on DAFFODIL-2566:
-----------------------------------------

The following trace is similar to all of the failures:

 

[info] Test 
org.apache.daffodil.runtime2.TestEgressXdccBw.test_egress_xdcc_bw_unparse_20 
started
[error] Test 
org.apache.daffodil.runtime2.TestEgressXdccBw.test_egress_xdcc_bw_unparse_20 
failed: org.apache.daffodil.tdml.TDMLExceptionImpl: (Implementation: 
daffodil-runtime2) SchemaDefinitionError: Schema Definition Error: Error 
compiling generated code: CommandResult 1
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_writer.c: In 
function ‘binaryToHex’:
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_writer.c:89:5: 
error: ‘for’ loop initial declarations are only allowed in C99 mode
[error] for (size_t i = 0; i < hexBinary.lengthInBytes; i++)
[error] ^
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_writer.c:89:5: 
note: use option -std=c99 or -std=gnu99 to compile your code
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_reader.c: In 
function ‘strtohexbinary’:
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_reader.c:271:5: 
error: ‘for’ loop initial declarations are only allowed in C99 mode
[error] for (size_t i = 0; i < numNibbles; i++)
[error] ^
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_reader.c:271:5: 
note: use option -std=c99 or -std=gnu99 to compile your code
[error] wd: /tmp/daffodil-runtime2-6286372821754379707/c
[error] SchemaDefinitionError: Schema Definition Error: No executable was 
built: /tmp/daffodil-runtime2-6286372821754379707/c/daffodil, took 0.003 sec
[error] at org.apache.daffodil.tdml.TDMLException$.apply(TDMLException.scala:33)
[error] at 
org.apache.daffodil.tdml.UnparserTestCase.$anonfun$runProcessor$5(TDMLRunner.scala:1379)
[error] at scala.util.Either$LeftProjection.foreach(Either.scala:508)
[error] at 
org.apache.daffodil.tdml.UnparserTestCase.runProcessor(TDMLRunner.scala:1379)
[error] at org.apache.daffodil.tdml.TestCase.run(TDMLRunner.scala:903)
[error] at 
org.apache.daffodil.tdml.DFDLTestSuite.runOneTest(TDMLRunner.scala:418)
[error] at org.apache.daffodil.tdml.Runner.runOneTest(RunnerFactory.scala:191)
[error] at org.apache.daffodil.tdml.Runner.runOneTest(RunnerFactory.scala:197)
[error] at 
org.apache.daffodil.runtime2.TestEgressXdccBw.test_egress_xdcc_bw_unparse_20(TestEgressXdccBw.scala:53)
[error] ...
[error] Caused by: Schema Definition Error: Error compiling generated code: 
CommandResult 1
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_writer.c: In 
function ‘binaryToHex’:
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_writer.c:89:5: 
error: ‘for’ loop initial declarations are only allowed in C99 mode
[error] for (size_t i = 0; i < hexBinary.lengthInBytes; i++)
[error] ^
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_writer.c:89:5: 
note: use option -std=c99 or -std=gnu99 to compile your code
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_reader.c: In 
function ‘strtohexbinary’:
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_reader.c:271:5: 
error: ‘for’ loop initial declarations are only allowed in C99 mode
[error] for (size_t i = 0; i < numNibbles; i++)
[error] ^
[error] /tmp/daffodil-runtime2-6286372821754379707/c/libcli/xml_reader.c:271:5: 
note: use option -std=c99 or -std=gnu99 to compile your code
[error] wd: /tmp/daffodil-runtime2-6286372821754379707/c
[error] at 
org.apache.daffodil.runtime2.CodeGenerator.error(CodeGenerator.scala:190)
[error] at 
org.apache.daffodil.runtime2.CodeGenerator.compileCode(CodeGenerator.scala:135)
[error] at 
org.apache.daffodil.tdml.processor.Runtime2TDMLDFDLProcessorFactory.getProcessor(Runtime2TDMLDFDLProcessor.scala:116)
[error] at 
org.apache.daffodil.tdml.DFDLTestSuite.$anonfun$getCompileResult$1(TDMLRunner.scala:511)
[error] at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:86)
[error] at 
org.apache.daffodil.tdml.DFDLTestSuite.getCompileResult(TDMLRunner.scala:506)
[error] at org.apache.daffodil.tdml.TestCase.run(TDMLRunner.scala:879)
[error] at 
org.apache.daffodil.tdml.DFDLTestSuite.runOneTest(TDMLRunner.scala:418)
[error] at org.apache.daffodil.tdml.Runner.runOneTest(RunnerFactory.scala:191)
[error] at org.apache.daffodil.tdml.Runner.runOneTest(RunnerFactory.scala:197)
[error] at 
org.apache.daffodil.runtime2.TestEgressXdccBw.test_egress_xdcc_bw_parse_11(TestEgressXdccBw.scala:34)
[error] ... 55 more

> Extend C code generator to support hexBinary elements
> -----------------------------------------------------
>
>                 Key: DAFFODIL-2566
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2566
>             Project: Daffodil
>          Issue Type: New Feature
>          Components: Back End C-Generator
>    Affects Versions: 3.1.0
>            Reporter: John Interrante
>            Assignee: John Interrante
>            Priority: Blocker
>             Fix For: 3.2.0
>
>
> Allow Daffodil to generate C code from DFDL schemas using the type
> "hexBinary" for fixed length and prefixed length opaque byte arrays.
> The "hex" simply means that the binary 8-bit bytes are represented by
> hexadecimal characters in the XML infoset and the C code knows how to
> convert between these binary and text representations when parsing
> binary bytes or unparsing XML infosets. Add hexBinary elements to the
> ex_nums test schema to exercise the new code.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to