AGWA / AGWA/git-crypt

(cygwin?) gcc 7.3.0 mkstemp compile error (and solution)

Aberta
#152 2 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
C++
Estrelas
9.9k
Forks
544
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

on cygwin (will test on linux) there is a compile error complaining

util-unix.cpp:79:13: error: 'mkstemp' was not declared in this scope

according to this https://stackoverflow.com/questions/21689124/mkstemp-and-fdopen-in-cygwin-1-7-28 this is due to --std=c++11 defining U__STRICT_ANSI__
a solution is to relax the std=c++11, another would be to drop the dependency on mkstemp and use http://en.cppreference.com/w/cpp/io/c/tmpnam or best http://en.cppreference.com/w/cpp/io/c/tmpfile

diff --git a/Makefile b/Makefile
index 68eb9db..3a2be61 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
#

CXXFLAGS ?= -Wall -pedantic -Wno-long-long -O2
-CXXFLAGS += -std=c++11
+CXXFLAGS += -std=c++11 -U__STRICT_ANSI__
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.