ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Дмитрий Ханжин" <dmitriy.khanzhin@gmail.com>
To: devel@lists.altlinux.org
Subject: Re: [devel] Что это? Переопределение функций?
Date: Sun, 30 Jul 2017 21:12:53 +0300
Message-ID: <043c96a8-c577-6952-09be-2ed9f7e44845@gmail.com> (raw)
In-Reply-To: <a7c1edb5-157c-c380-3637-4d7df37b693f@etersoft.ru>

30.07.2017 20:00, Pavel Vainerman пишет:
> 
>   Ну вроде как определение здесь
> /usr/src/RPM/BUILD/icewm-githubmod/src/base.h
> конфликтует с определением здесь
> /usr/include/string.h
> 
> Здесь не видно.. но судя по.. has a different exception specifier
> не совпадает по спецификации исключений.
> 
> у меня в /usr/include/string.h
> 
> extern size_t strlcpy (char *__dst, __const char *__src, size_t __n)
>       __THROW __nonnull ((1, 2));
> 
> смотрите что там в icewm-githubmod/src/base.h
> 

В /usr/include/string.h:
#ifdef __USE_MISC
/* Copy at most N - 1 characters from SRC to DEST.  */
extern size_t strlcpy (char *__restrict __dest,
		       const char *__restrict __src, size_t __n)
   __THROW __nonnull ((2));

/* Append SRC to DEST, possibly with truncation to keep the total size
    below N.  */
extern size_t strlcat (char *__restrict __dest,
		       const char *__restrict __src, size_t __n)
   __THROW __nonnull ((2));
#endif

В src/base.h:
/* Prefer this as a safer alternative over strcpy. Return strlen(from). */
size_t strlcpy(char *dest, const char *from, size_t dest_size);
/* Prefer this over strcat. Return strlen(dest) + strlen(from). */
size_t strlcat(char *dest, const char *from, size_t dest_size);

Вроде как определения похожи, нафига продублировали.
Вымарал из base.h, собралось. Работоспособность пока не проверял.
Как же-ж лучше сделать?


  reply	other threads:[~2017-07-30 18:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-30 16:56 Дмитрий Ханжин
2017-07-30 17:00 ` Pavel Vainerman
2017-07-30 18:12   ` Дмитрий Ханжин [this message]
2017-07-30 18:57     ` Pavel Vainerman
2017-07-31  5:13       ` Дмитрий Ханжин
2017-07-31  9:58         ` Michael Shigorin
2017-07-31 10:15           ` Konstantin Lepikhov
2017-07-31 10:52             ` Dmitry V. Levin
2017-07-31 18:56               ` Дмитрий Ханжин
2017-07-31 19:30                 ` Dmitry V. Levin
2017-08-01 17:42                   ` [devel] [thx] " Дмитрий Ханжин

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=043c96a8-c577-6952-09be-2ed9f7e44845@gmail.com \
    --to=dmitriy.khanzhin@gmail.com \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git