Opened 10 years ago

Closed 2 years ago

#47476 closed defect (fixed)

scons does not properly add header guards to generated config header

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), bitpup, udbraumann
Port: scons

Description

/usr/bin/llvm-g++-4.2 -arch x86_64 -o libgpsmm.os -c -Os -arch x86_64 -Wmissing-declarations -O2 -fPIC -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include libgpsmm.cpp
cc1plus: warning: command line option "-Wmissing-declarations" is valid for C/ObjC but not for C++
In file included from compiler.h:23,
                 from strfuncs.h:14,
                 from json.c:78:
gpsd_config.h:305: error: redefinition of typedef 'clockid_t'
gpsd_config.h:305: error: previous declaration of 'clockid_t' was here
/usr/bin/llvm-gcc-4.2 -arch x86_64 -o ntpshmread.os -c -Os -arch x86_64 -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -pthread -Wmissing-declarations -O2 -fPIC -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include ntpshmread.c
Creating 'gpsd.h'
/usr/bin/llvm-gcc-4.2 -arch x86_64 -o clock_gettime.os -c -Os -arch x86_64 -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -pthread -Wmissing-declarations -O2 -fPIC -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include clock_gettime.c
/usr/bin/llvm-gcc-4.2 -arch x86_64 -o strl.os -c -Os -arch x86_64 -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -pthread -Wmissing-declarations -O2 -fPIC -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include strl.c
scons: *** [json.os] Error 1
scons: building terminated because of errors.
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_gpsd/gpsd/work/gpsd-3.14" && /opt/local/bin/scons -j8 prefix=/opt/local libQgpsmm=no usb=no strip=no 
Exit code: 2

Attachments (1)

main.log (18.5 KB) - added by ballapete (Peter "Pete" Dyballa) 10 years ago.
main.log

Download all attachments as: .zip

Change History (15)

Changed 10 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

main.log

comment:1 Changed 10 years ago by bitpup

Cc: wheeltong@… added

Cc Me!

comment:2 Changed 10 years ago by udbraumann

Cc: braumann@… added

Cc Me!

comment:3 in reply to:  1 Changed 10 years ago by udbraumann

building also fails on 10.5.8 with this redefinition of typedef 'clockid_t' error

comment:4 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Owner: changed from macports-tickets@… to landonf@…
Port: scons added; gpsd removed
Summary: Building of gpsd 3.14 fails on Snow Leopard, Mac OS X 10.6.8, because of redefinition of typedef 'clockid_t'scons does not properly add header guards to generated config header
In file included from ais_json.c:23:
In file included from ./libgps.h:13:
In file included from ./compiler.h:23:
./gpsd_config.h:305:13: error: redefinition of typedef 'clockid_t' is invalid in C [-Wtypedef-redefinition]
typedef int clockid_t;
            ^
In file included from ais_json.c:19:
./gpsd_config.h:305:13: note: previous definition is here
typedef int clockid_t;
            ^
1 error generated.

The issue is that gpsd_config.h is included twice, and the header doesn't properly guard for that as it should.

/* gpsd_config.h.  Generated by scons, do not hand-hack.  */

As such, this is a scons bug.

comment:5 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from landonf@… to macports-tickets@…

comment:6 Changed 8 years ago by larryv (Lawrence Velázquez)

I’ve updated scons to 2.5.1. Is this still an issue?

comment:7 Changed 8 years ago by bitpup

Cc: bitpup added

comment:8 Changed 8 years ago by bitpup

Cc: bitpup removed

comment:9 Changed 8 years ago by bitpup

Cc: bitpup added

comment:10 Changed 8 years ago by bitpup

Cc: bitpup removed

comment:11 in reply to:  6 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Replying to larryv:

I’ve updated scons to 2.5.1. Is this still an issue?

No. Because the new Scones came as a compiled image to me …

comment:12 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

The ticket wasn't about whether scons could build or whether it was distributed as a prebuilt archive. The ticket was about whether scons-generated headers have include guards. Do they now? If they still don't, and you think they should, please file a bug report with the developers of scons.

comment:13 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

This port does not seem needed anymore, so IMO this ticket can be closed. In future GCC 1x will be used, so I heard (or rather read)…

comment:14 Changed 2 years ago by kencu (Ken)

Resolution: fixed
Status: newclosed

closing as fixed. A new ticket with new information would be needed if this arises again.

Note: See TracTickets for help on using tickets.