Opened 13 years ago

Closed 13 years ago

#30796 closed defect (fixed)

detex: non-void function 'InputFile' should return a value [-Wreturn-type]

Reported by: graham.dennis@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.0.1
Keywords: haspatch clang Cc: rex4539 (Dimitris Apostolou), bradskins@…, roy@…
Port: detex

Description

On Mac OS X Lion (and Xcode 4.2), when trying to install detex I get a compile failure which seems to be because clang is more fussy about code quality.

I've attached the build log.

Attachments (2)

main.log (11.7 KB) - added by graham.dennis@… 13 years ago.
build log
patch-Makefile.diff (353 bytes) - added by roy@… 13 years ago.
Patched patch file for Makefile; adds -Wno-return-type

Download all attachments as: .zip

Change History (12)

Changed 13 years ago by graham.dennis@…

Attachment: main.log added

build log

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…
Port: detex added

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

I have sent the developer of detex a link to this ticket.

comment:3 Changed 13 years ago by rex4539 (Dimitris Apostolou)

Cc: rex_4539@… added

Cc Me!

comment:4 Changed 13 years ago by bradskins@…

Cc: bradskins@… added

Cc Me!

comment:5 Changed 13 years ago by roy@…

I've had the same problem. The source code appears sloppy respecting missing return values. Not quite sure why. I guess it must be a legacy C "feature."

Managed to get it to compile on Lion using Xcode 4.2 tools by adding -Wno-return-type to the compile-time options. Did this by naughtily patching the patch file! See attached patch-Makefile.diff file.

Changed 13 years ago by roy@…

Attachment: patch-Makefile.diff added

Patched patch file for Makefile; adds -Wno-return-type

comment:6 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: roy@… added
Keywords: haspatch added
Summary: detex @2.8 Compile error - build failuredetex: non-void function 'InputFile' should return a value [-Wreturn-type]

Roy, it looks like your patch also adds -DNO_MALLOC_DECL; is that also necessary to fix this problem?

comment:7 Changed 13 years ago by roy@…

Dear Ryan, I didn't add that; it was already there. I just added the no-warning option in addition. I assume it need the NO_MALLOC_DECL too.

comment:8 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Your patch shows that the line was previously commented out, as in not being used at all. Now you uncommented it which cause that option to be used. I just don't know the significance of adding that option so I'd prefer not to add it if it's not necessary to solve this problem.

comment:9 Changed 13 years ago by roy@…

Ah, that's where my naughtiness came in. I patched the patch, by just editing the patch file. So the original patch uncommented. My patch-patch uncommented and added a new option! Naughty.

comment:10 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: clang added
Resolution: fixed
Status: newclosed

Oh! Now I understand.

I can reproduce the problem with clang on Snow Leopard with Xcode 3.2.6.

Committed your patch in r84883. Thanks.

Note: See TracTickets for help on using tickets.