From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id D87F7DE0 for ; Tue, 14 Jan 2014 12:28:16 +0100 (CET) Received: by mail-wi0-f182.google.com with SMTP id ex4so556888wid.9 for ; Tue, 14 Jan 2014 03:29:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:organization:to:subject:date:user-agent:cc :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=V0RHhqxT/3e5YfVyjiiXSOysAGSyWy3NbKa0LdOkDWw=; b=gORWA1N6y0utmFWnVD0Um0NIlFUvUTlAbA0F9Q/eRtN1fr8u6xZiyIlq1e5M45nEBK +7S5TqzKX6+tu8zIzBBH//GtbBy5UPcbJ6iaRITfrj31jsDjjmKe9W6evgrArz3JNCts ril+u9L5Pk+/isjVTRSRd1WkE9+0g5rsurmp5CFhzxMI4I+4y7GKMz1h4Jzo/ISZUEBB CqIgCjI6VzTI5wfxNhN21jEypxyx0nmKgZBeZvCQOa9hpWTiWXKRl5pTlIfvxchcrk6/ eD8x1RWcdLdQp/bfH+li8MYgWGGGDMz3y9splQYyVjUnMOgGIDblYaw4MZrWQDbKg/79 Se5Q== X-Gm-Message-State: ALoCoQkaYg+Uv9YOvaSd3EsAIb57loGQye2BOUSfUUtcW12m2nPcJzSBfdIWtSG2eE28AceKGGIP X-Received: by 10.180.20.33 with SMTP id k1mr2371734wie.34.1389698970340; Tue, 14 Jan 2014 03:29:30 -0800 (PST) Received: from angus.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id po3sm260604wjc.3.2014.01.14.03.29.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jan 2014 03:29:29 -0800 (PST) From: Thomas Monjalon Organization: 6WIND To: Dan Kan Date: Tue, 14 Jan 2014 12:29:27 +0100 User-Agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201401141229.27614.thomas.monjalon@6wind.com> Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Changes to makefiles to allow building apps using g++ X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jan 2014 11:28:17 -0000 Hello Dan, 13/01/2014 23:45, Dan Kan: > I made changes to makefiles to at least allow app development to be in done > C++. I'm wondering if the community is interested in getting these changes > as a patch. If you need it, it's an excellent reason to integrate it. Moreover we can guess that you're not alone to have this need. > The dpdk library must still be compiled using gcc. However, the > applications can be compiled using g++ by setting CC=g++, e.g. "make > CC=g++". With g++, non-trivial designated initializers will no longer be > allowed among others. As a result, most sample apps cannot be compiled > using g++ without modifications; hello world app works with g++. You will > also need to specify your c++ file extension if it's not named cpp, e.g. > make CC=g++ CXX-suffix=cc. The behavior for gcc or icc compilation remains > unmodified. Anyway, let me know if it's worthwhile to submit a patch. I think that it should be documented. What about a file doc/build-app.rst ? You could start documenting how it is different for C++. > +ifeq ($(CC), $(CROSS)g++) > +TOOLCHAIN_CFLAGS += -D__STDC_LIMIT_MACROS > +WERROR_FLAGS := -W -Wall -Werror > +WERROR_FLAGS += -Wmissing-declarations -Wpointer-arith > +WERROR_FLAGS += -Wcast-align -Wcast-qual > +else > WERROR_FLAGS := -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes > WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition > -Wpointer-arith > WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual > +endif > WERROR_FLAGS += -Wformat-nonliteral -Wformat-security Could you factorize the common flags, please ? Thank you -- Thomas