Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001304 [1003.1(2016)/Issue7+TC2] Shell and Utilities Editorial Enhancement Request 2019-11-27 11:15 2019-11-27 16:04
Reporter joerg View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name Jörg Schilling
Organization
User Reference
Section C99
Page Number 2543
Line Number 82297-8298
Interp Status ---
Final Accepted Text
Summary 0001304: Align c99 -o with reality, the standard should not be more restrictive than implementations
Description The text:

-o outfile
    Use the pathname outfile, instead of the default a.out, for the executable file produced. If the -o option is present with -c or -E, the result is unspecified.

Does not reflect the behavior of C-compilers since more than 35 years.

The option -o always works with sall known compiler implementations together with -c. It is important to be able to tell the compiler to directly create a named output file for a c99 -c xx.c compilation in order to avoid file clobbering with concurrent compilations that would be the result from compiling to a standard file name and then being forved to rename the output file.
Desired Action Change:

-o outfile
    Use the pathname outfile, instead of the default a.out, for the executable file produced. If the -o option is present with -c or -E, the result is unspecified.

to:

-o outfile
    Use the pathname outfile, instead of the default a.out, for the executable file produced. If the -o option is present with -E, the result is unspecified.
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0004670)
geoffclare (manager)
2019-11-27 15:53

Your claim that -o "always works with all known compiler implementations together with -c" is incorrect. It does not work with the HP-UX compiler.

Also, the requested change is both wrong and insufficient.

It is wrong because the unchanged part "the default a.out, for the executable file produced" makes no sense when -c is used.

It is insufficient because removing the statement that the behaviour is unspecified does not magically make it become specified. You need to propose additional wording to specify the behaviour, and it needs to cover these points:

1. What happens if you specify -c and -o together with more than one .c file

2. What happens if the -o option-argument specifies a directory

(With some compilers, cc -o dir -c file1.c file2.c creates dir/file1.o and dir/file2.o)
(0004671)
joerg (reporter)
2019-11-27 16:04
edited on: 2019-11-27 16:07

Your claim about the HP-UX compiler is wrong, see the related rules in the Schily Makefilesystem that work fine on HP-UX and all other platforms that are relevant.

This even works for "cl.exe"... you just need to use -Fo instead.

Regarding finding a better wording: you are of course welcome!


- Issue History
Date Modified Username Field Change
2019-11-27 11:15 joerg New Issue
2019-11-27 11:15 joerg Name => Jörg Schilling
2019-11-27 11:15 joerg Section => C99
2019-11-27 11:15 joerg Page Number => 2543
2019-11-27 11:15 joerg Line Number => 82297-8298
2019-11-27 15:53 geoffclare Note Added: 0004670
2019-11-27 16:04 joerg Note Added: 0004671
2019-11-27 16:07 joerg Note Edited: 0004671


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker