Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jan 2002 15:41:47 -0800 (PST)
From:      Vladimir Kushnir <vkushnir@Alfacom.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/33590: imaxabs(3), imaxdiv(3) does not work with C++ linkage
Message-ID:  <200201052341.g05Nflp70161@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         33590
>Category:       misc
>Synopsis:       imaxabs(3), imaxdiv(3) does not work with C++ linkage
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 05 15:50:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Vladimir Kushnir
>Release:        FreeBSD-CURRENT
>Organization:
ITP
>Environment:
FreeBSD kushnir1.kiev.ua 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Sun Dec 30 10:26:14 EET 2001     root@kushnir1.kiev.ua:/usr/obj/usr/ncvs/src/sys/KUSHNIR  i386    
>Description:
Libc functions imaxabs(3), imaxdiv(3) used in C++ programs lead to "undefined 
reference" errors.   
>How-To-Repeat:
Compile as C++ this code:
/* test.cc */
#include <inttypes.h>

main() {
intmax_t a = 1;
intmax_t b;
imaxdiv_t c;
b = imaxabs(a);
c = imaxdiv(a, b);
}

Output:
~> c++ -o itest test.cc
/tmp/ccplyujk.o: In function `main':
/tmp/ccplyujk.o(.text+0x21): undefined reference to `imaxabs(long long)'
/tmp/ccplyujk.o(.text+0x4e): undefined reference to `imaxdiv(long long, long long)'


>Fix:
      
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201052341.g05Nflp70161>