www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - lib'ing *.obj

↑ ↓ ← comeau panix.com (Greg Comeau) writes:
How can I specify a wildstar to add a bunch of .obj's into a lib,
using lib?

Also, lib has the same name as MS's lib command, therefore creating
a conflict.  Are they intended to be compatible?
-- 
Greg Comeau   What's next: additional Windows backends and 'export'!
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
Jan 12 2002
comeau panix.com (Greg Comeau) writes:
Given code such as follows:

void foo(); // No prototype, just a declaration

int main()
{
  foo(99); // Expects at least foo(int)
  foo("hi"); // Expects at least foo(char *)

  return 0;
}

sc will diagnoses:
  foo("hi");
          ^
syn.c(6) : Error: need explicit cast for function parameter 1 to get
from: char *
to  : int
--- errorlevel 1

Clearly this is undefined behavior, but in case where say
the arguments were pointers to function of different types
the danger is minimal, especially when done on purpose.
Therefore, I feel the the above is too strong an error message.
Is there an option to control it?
-- 
Greg Comeau   What's next: additional Windows backends and 'export'!
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
Jan 12 2002
↑ ↓ "Walter" <walter digitalmars.com> writes:
Yes, -p turns off autoprototyping.

"Greg Comeau" <comeau panix.com> wrote in message
news:a1puqu$jaj$1 panix3.panix.com...
 Given code such as follows:

 void foo(); // No prototype, just a declaration

 int main()
 {
   foo(99); // Expects at least foo(int)
   foo("hi"); // Expects at least foo(char *)

   return 0;
 }

 sc will diagnoses:
   foo("hi");
           ^
 syn.c(6) : Error: need explicit cast for function parameter 1 to get
 from: char *
 to  : int
 --- errorlevel 1

 Clearly this is undefined behavior, but in case where say
 the arguments were pointers to function of different types
 the danger is minimal, especially when done on purpose.
 Therefore, I feel the the above is too strong an error message.
 Is there an option to control it?
 --
 Greg Comeau   What's next: additional Windows backends and 'export'!
 Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
 World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
 Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

Jan 12 2002
↑ ↓ → comeau panix.com (Greg Comeau) writes:
In article <a1q1pg$1arq$5 digitaldaemon.com>,
Walter <walter digitalmars.com> wrote:
Yes, -p turns off autoprototyping.

Oh, ok, for some reason I though that generate function prototypes to a file, for generated headers from old C code.... -- Greg Comeau What's next: additional Windows backends and 'export'! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
Jan 12 2002
"Walter" <walter digitalmars.com> writes:
"Greg Comeau" <comeau panix.com> wrote in message
news:a1ppke$q66$1 panix3.panix.com...
 How can I specify a wildstar to add a bunch of .obj's into a lib,
 using lib?

Can't. Gotta do it one by one!
 Also, lib has the same name as MS's lib command, therefore creating
 a conflict.  Are they intended to be compatible?

DM LIB is closely compatible with older implementations of MS lib. Microsoft completely changed how theirs worked. Same for the linker.
Jan 12 2002
↑ ↓ comeau panix.com (Greg Comeau) writes:
In article <a1q1pf$1arq$4 digitaldaemon.com>,
Walter <walter digitalmars.com> wrote:
"Greg Comeau" <comeau panix.com> wrote in message
news:a1ppke$q66$1 panix3.panix.com...
 Also, lib has the same name as MS's lib command, therefore creating
 a conflict.  Are they intended to be compatible?

DM LIB is closely compatible with older implementations of MS lib. Microsoft completely changed how theirs worked. Same for the linker.

So _must_ one invoke the dm lib.exe and link.exe? What happens if MS's lib.exe or link.exe is used by mistake do to PATH orientation? It seem to work, so what I'm asking probably is, under what circumstances won't it work? Only with new MS compilers? If so, what versions == new? -- Greg Comeau What's next: additional Windows backends and 'export'! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
Jan 12 2002
↑ ↓ → "Walter" <walter digitalmars.com> writes:
Microsoft changed their .obj file format from OMF to COFF. The DM compilers
still generate OMF, which Microsoft's tools cannot handle anymore. MS made
the switch when they abandoned 16 bit support.

It's necessary to use the DM linker and DM lib with the output of DMC++.

You'll need to adjust PATH so /dm/bin precedes Microsoft's tools bin. It
isn't necessary to adjust INCLUDE, etc., because sc.exe will pull it out of
\dm\bin\sc.ini.

"Greg Comeau" <comeau panix.com> wrote in message
news:a1q3b4$q0j$1 panix3.panix.com...
 In article <a1q1pf$1arq$4 digitaldaemon.com>,
 Walter <walter digitalmars.com> wrote:
"Greg Comeau" <comeau panix.com> wrote in message
news:a1ppke$q66$1 panix3.panix.com...
 Also, lib has the same name as MS's lib command, therefore creating
 a conflict.  Are they intended to be compatible?

DM LIB is closely compatible with older implementations of MS lib.


completely changed how theirs worked. Same for the linker.

So _must_ one invoke the dm lib.exe and link.exe? What happens if MS's lib.exe or link.exe is used by mistake do to PATH orientation? It seem to work, so what I'm asking probably is, under what circumstances won't it work? Only with new MS compilers? If so, what versions == new? -- Greg Comeau What's next: additional Windows backends and 'export'! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

Jan 12 2002