This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 383 - EIGEN_ASM_COMMENT broken in C++11
Summary: EIGEN_ASM_COMMENT broken in C++11
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: unspecified
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-26 22:45 UTC by Marc
Modified: 2019-12-04 11:17 UTC (History)
2 users (show)



Attachments

Description Marc 2011-11-26 22:45:35 UTC
Hello,

with the introduction of user-defined literals, C++11 is not happy when you write a string directly followed by a letter or underscore (or anything that could be the name of a suffix). In Eigen, that's mostly EIGEN_ASM_COMMENT, but there are also a few occurences in bench/btl/generic_bench/btl.hh, test/main.h, test/eigen2/main.h. All you need is an extra space in between.
Comment 1 Benoit Jacob 2011-11-26 23:21:29 UTC
Thanks for the report. Indeed,

$ grep -R '"[^"]"[_a-zA-Z0-9]' . | grep -v \\.hg | grep -v '~:'
./Eigen/src/Core/util/Macros.h.orig:#define EIGEN_ASM_COMMENT(X)  asm("#"X)
./Eigen/src/Core/util/Macros.h:#define EIGEN_ASM_COMMENT(X)  asm("#"X)
./cmake/EigenDetermineOSVersion.cmake:    exec_program( ${SHELL} ARGS "/c" "ver"
./doc/Doxyfile.in:# replaced with the name of the entity): "The $name class" "The $name widget"
./doc/Doxyfile.in:# "The $name file" "is" "provides" "specifies" "contains"
./doc/Doxyfile.in:# "represents" "a" "an" "the"
./doc/eigendoxy_header.html.in:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
./unsupported/doc/Doxyfile.in:# replaced with the name of the entity): "The $name class" "The $name widget"
./unsupported/doc/Doxyfile.in:# "The $name file" "is" "provides" "specifies" "contains"
./unsupported/doc/Doxyfile.in:# "represents" "a" "an" "the"
./unsupported/test/CMakeLists.txt.orig:    ei_add_test(FFTW  "-DEIGEN_FFTW_DEFAULT -DEIGEN_HAS_FFTWL" "fftw3;fftw3f;fftw3l" )
./unsupported/test/CMakeLists.txt.orig:    ei_add_test(FFTW  "-DEIGEN_FFTW_DEFAULT " "fftw3;fftw3f" )
./bench/btl/generic_bench/btl.hh:#define BTL_ASM_COMMENT(X)  asm("#"X)
./bench/bench_gemm.cpp:    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/t.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << t.total(CPU_TIMER)  << "s)\n";
./bench/bench_gemm.cpp:    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/t.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << t.total(REAL_TIMER) << "s)\n";
./bench/bench_gemm.cpp:    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/t.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << t.total(CPU_TIMER)  << "s)\n";
./bench/bench_gemm.cpp:    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/t.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << t.total(REAL_TIMER) << "s)\n";
./bench/bench_gemm.cpp:    std::cout << "\"matlab\" cpu    " << t.best(CPU_TIMER)/rep  << "s  \t" << (double(m)*n*p*rep*2/t.best(CPU_TIMER))*1e-9  <<  " GFLOPS \t(" << t.total(CPU_TIMER)  << "s)\n";
./bench/bench_gemm.cpp:    std::cout << "\"matlab\" real   " << t.best(REAL_TIMER)/rep << "s  \t" << (double(m)*n*p*rep*2/t.best(REAL_TIMER))*1e-9 <<  " GFLOPS \t(" << t.total(REAL_TIMER) << "s)\n";
Comment 2 Benoit Jacob 2011-11-26 23:57:14 UTC
changeset:   4351:64662a88582a
branch:      3.0
tag:         tip
parent:      4343:c0a1d0e5ea0c
user:        Marc Glisse <marc.glisse@gmail.com>
date:        Sat Nov 26 17:55:18 2011 -0500
summary:     Bug 383 - EIGEN_ASM_COMMENT broken in C++11

changeset:   4350:019ebf7f9642
user:        Marc Glisse <marc.glisse@gmail.com>
date:        Sat Nov 26 17:55:18 2011 -0500
summary:     Bug 383 - EIGEN_ASM_COMMENT broken in C++11
Comment 3 Benoit Jacob 2011-11-26 23:59:00 UTC
(I didn't find the other occurences you were talking about)
Comment 4 Marc 2011-11-27 09:34:46 UTC
In test/main.h, line 128:
        eigen_assert_list.push_back(std::string(EI_PP_MAKE_STRING(__FILE__)" ("EI_PP_MAKE_STRING(__LINE__)") : "#a) ); \

(Found by grep, not sure why you don't have it)
Comment 5 Benoit Jacob 2011-11-27 21:28:37 UTC
Thanks!

changeset:   4352:3c7638949b8c
parent:      4350:019ebf7f9642
user:        Marc Glisse <marc.glisse@gmail.com>
date:        Sun Nov 27 15:27:25 2011 -0500
summary:     Bug 383 - another c++11-user-defined-literal fix

changeset:   4353:eecd3c1a481c
branch:      3.0
tag:         tip
parent:      4351:64662a88582a
user:        Marc Glisse <marc.glisse@gmail.com>
date:        Sun Nov 27 15:27:25 2011 -0500
summary:     Bug 383 - another c++11-user-defined-literal fix
Comment 6 Nobody 2019-12-04 11:17:30 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/383.

Note You need to log in before you can comment on or make changes to this bug.