Project

General

Profile

Bug #130

include files are included more than once.

Added by Fran├žois Ingrand almost 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal

Description

Included struct files are not properly CPP parsed when calling genom3 with more than one component.

As a result, one get redefinition errors:

felix@Trusty64:~/work/rob/build-all$ genom3 bip/server-pocolibs ../robmotion/robmotion.gen ../robloco/robloco.gen
robsim-struct.idl:6: declaration of 'task_period' clashes with existing const
robsim-struct.idl:6:   const 'task_period' declared here
robsim-struct.idl:6: dropped declaration for 'task_period'
robsim-struct.idl:8: declaration of 'half_map_size' clashes with existing const
robsim-struct.idl:8:   const 'half_map_size' declared here
robsim-struct.idl:8: dropped declaration for 'half_map_size'
robsim-struct.idl:11: declaration of 'UNKNOWN' clashes with existing enumerator
robsim-struct.idl:11:   enumerator 'UNKNOWN' declared here

Associated revisions

Revision 6257a670 (diff)
Added by Anthony Mallet almost 2 years ago

Allow parsing multiple input files including the same files (#130)

In order to properly parse multiple input files specified on the command line,
one must prevent included files to be included multiple times. Include guards
or pragma once were useless because each input file was processed by a
different instance of the cpp program.

This commit allows parsing multiple files within the same cpp process (thus
enabling include guards), by creating a temporary articifial input file whose
purpose is to #include all the original input files.

This change makes the genom3 '-r' option obsolete, that is thus dropped. Since
the articial input file is always used and is named "input.c", any cpp program
should recognize this as a C source code.

Revision c139d8ef (diff)
Added by Anthony Mallet almost 2 years ago

skeleton, interactive and mapping templates parse input files in one go (#130)

If multiple files are specified on those templates command line, parse them
with the same cpp process, so that multiply included files can be properly
"include guarded".

Revision 37ef114d (diff)
Added by Anthony Mallet almost 2 years ago

Parse input files in one go (issue #130)

If multiple files are specified on those templates command line, parse them
with the same cpp process, so that multiply included files can be
properly "include guarded".

Revision 90ac3a67 (diff)
Added by Anthony Mallet almost 2 years ago

Parse input files in one go (issue #130)

If multiple files are specified on those templates command line, parse them
with the same cpp process, so that multiply included files can be
properly "include guarded".

History

#1

Updated by Anthony Mallet almost 2 years ago

  • Status changed from New to Feedback

Should be better now, can you confirm?

Note: you need to change your template to parse all files in one go,
see e.g. genom3-pocolibs:37ef114d

#2

Updated by Anthony Mallet over 1 year ago

Any feedback?

#3

Updated by Anthony Mallet about 1 year ago

  • Status changed from Feedback to Closed

No feeback. Assuming "fixed".

Also available in: Atom PDF