public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
@ 2011-08-11 13:36 ml@convergent-it.at
  2011-08-11 13:38 ` [Bug c++/50044] " ml@convergent-it.at
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-11 13:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

             Bug #: 50044
           Summary: Attributes for explicit template instantiation are
                    ignored after an implicit template instantiation
                    occurred.
    Classification: Unclassified
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ml@convergent-it.at


Created attachment 24976
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24976
Preprocessed file which shows the main problem.

Information about the used GCC:
  Using built-in specs.
  COLLECT_GCC=i686-mingw32-gcc
 
COLLECT_LTO_WRAPPER=/home/martin/mingw-4.5.2-new/install-i686-pc-linux-gnu/libexec/gcc/i686-mingw32/4.5.2/lto-wrapper
  Target: i686-mingw32
  Configured with: ../configure --build=i686-pc-linux-gnu
--host=i686-pc-linux-gnu --target=i686-mingw32
--prefix=/home/martin/mingw-4.5.2-new/install-i686-pc-linux-gnu
--with-gmp=/home/martin/mingw-4.5.2-new/install-i686-pc-linux-gnu
--with-mpfr=/home/martin/mingw-4.5.2-new/install-i686-pc-linux-gnu
--with-mpc=/home/martin/mingw-4.5.2-new/install-i686-pc-linux-gnu
--with-ppl=/home/martin/mingw-4.5.2-new/install-i686-pc-linux-gnu
--with-cloog=/home/martin/mingw-4.5.2-new/install-i686-pc-linux-gnu
--enable-threads=win32 --enable-tls --enable-languages=c,c++
--with-sysroot=/home/martin/mingw-4.5.2-new/install-i686-pc-linux-gnu/i686-mingw32
--disable-win32-registry --enable-sjlj-exceptions --disable-libstdcxx-pch
--with-host-libstdcxx='-lstdc++ -lsupc++'
  Thread model: win32
  gcc version 4.5.2 (GCC)

Command line that triggers the problem:
  i686-mingw32-g++ -Wall -c -o A.cpp.obj A.cpp.i

Output of GCC:
  A.cpp:8:43: warning: type attributes ignored after type is already defined

Summary:
  Attributes for explicit template instantiation are ignored after an implicit
template instantiation occurred.

Description:
  I have a problem with explicit template instantiation and exporting it's
symbols into a DLL. The file which triggers the problem is attached - as
requested in preprocessed form (A.cpp.i) - although I will also attach the
whole project for completeness (better for discussion, and to be able to see
linker errors).

It seems, that A<int> gets implicitly instantiated (or the type is defined - I
do not know the correct nomenclature) in the create function. Then when the
compiler sees the explicit instantiation, it prints the warning that it ignores
the dllexport attribute, and thus the symbols for A<int> are not exported.
That's why I receive the linker error for the application later. If the create
function had not been in the code, then everything would work fine.

For completeness the output of make looks like this:
  i686-mingw32-g++ -Wall -shared -o dll.dll -DEXPORTS A.cpp
  A.cpp:8:26: warning: type attributes ignored after type is already defined
  i686-mingw32-g++ -Wall -o app.exe main.cpp dll.dll
  /tmp/cc87EyrC.o:main.cpp:(.text+0x4e): undefined reference to `A<int>::A()'
  /tmp/cc87EyrC.o:main.cpp:(.text+0x62): undefined reference to
`A<int>::doSomething()'
  /tmp/cc87EyrC.o:main.cpp:(.rdata$_ZTV1AIiE[vtable for A<int>]+0x10):
undefined reference to `A<int>::doSomething()'
  collect2: ld returned 1 exit status

In my opinion it makes sense to give attributes on an explicit template
instantiation precedence. It seems that attributes can only be assigned to the
type, when the compiler needs it the first time. This can be accomplished by
adding
  extern template class INTERFACE A<int>; //C++11
to A.h - but which should not be needed actually.

In this case, if I run make, then I still receive the warning, but the
dllexport attribute is applied. The output of make look now like:
  i686-mingw32-g++ -Wall -shared -o dll.dll -DEXPORTS -DUSE_EXTERN_TEMPLATE
A.cpp
  A.cpp:8:26: warning: type attributes ignored after type is already defined
  i686-mingw32-g++ -Wall -o app.exe -DUSE_EXTERN_TEMPLATE main.cpp dll.dll
  /tmp/ccv8Knzo.o:main.cpp:(.text+0x67): undefined reference to `typeinfo for
A<int>'
  collect2: ld returned 1 exit status
  make: *** [app.exe] Error 1

So actually I see two problems here:
  - The attributes on the explicit instantiation should have precedence.
  - When using "extern template..." there is something wrong with exporting the
symbols for the typeinfo (i686-mingw32-nm shows that they are in the dll, but
it seems that they are not exported).

Thank you for your help,

Martin Lederhilger


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
  2011-08-11 13:38 ` [Bug c++/50044] " ml@convergent-it.at
@ 2011-08-11 13:38 ` ml@convergent-it.at
  2011-08-11 13:39 ` ml@convergent-it.at
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-11 13:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #1 from Martin Lederhilger <ml@convergent-it.at> 2011-08-11 13:37:15 UTC ---
Created attachment 24977
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24977
A.cpp - goes into the DLL


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
@ 2011-08-11 13:38 ` ml@convergent-it.at
  2011-08-11 13:38 ` ml@convergent-it.at
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-11 13:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #2 from Martin Lederhilger <ml@convergent-it.at> 2011-08-11 13:38:02 UTC ---
Created attachment 24978
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24978
A.h - Header which is used by the DLL and the application


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (2 preceding siblings ...)
  2011-08-11 13:39 ` ml@convergent-it.at
@ 2011-08-11 13:39 ` ml@convergent-it.at
  2011-08-11 13:40 ` ml@convergent-it.at
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-11 13:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #3 from Martin Lederhilger <ml@convergent-it.at> 2011-08-11 13:38:47 UTC ---
Created attachment 24979
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24979
A_imp.h - Implementation of the template. This file is included in A.cpp


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
  2011-08-11 13:38 ` [Bug c++/50044] " ml@convergent-it.at
  2011-08-11 13:38 ` ml@convergent-it.at
@ 2011-08-11 13:39 ` ml@convergent-it.at
  2011-08-11 13:39 ` ml@convergent-it.at
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-11 13:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #4 from Martin Lederhilger <ml@convergent-it.at> 2011-08-11 13:39:31 UTC ---
Created attachment 24980
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24980
Interface.h - defines macros for the dllexport/import attributes


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (3 preceding siblings ...)
  2011-08-11 13:39 ` ml@convergent-it.at
@ 2011-08-11 13:40 ` ml@convergent-it.at
  2011-08-11 13:40 ` ml@convergent-it.at
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-11 13:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #6 from Martin Lederhilger <ml@convergent-it.at> 2011-08-11 13:40:40 UTC ---
Created attachment 24982
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24982
Makefile to build the DLL and the application.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (4 preceding siblings ...)
  2011-08-11 13:40 ` ml@convergent-it.at
@ 2011-08-11 13:40 ` ml@convergent-it.at
  2011-08-16 13:36 ` ml@convergent-it.at
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-11 13:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #5 from Martin Lederhilger <ml@convergent-it.at> 2011-08-11 13:40:07 UTC ---
Created attachment 24981
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24981
main.cpp - the application


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (5 preceding siblings ...)
  2011-08-11 13:40 ` ml@convergent-it.at
@ 2011-08-16 13:36 ` ml@convergent-it.at
  2011-08-16 14:17 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-16 13:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

Martin Lederhilger <ml@convergent-it.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.5.2                       |4.6.1

--- Comment #7 from Martin Lederhilger <ml@convergent-it.at> 2011-08-16 13:17:44 UTC ---
I have also tried it with a newer version of gcc, but I receive the same
results. Information about the new gcc version is listed below:

Using built-in specs.
COLLECT_GCC=i686-mingw32-g++
COLLECT_LTO_WRAPPER=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu/libexec/gcc/i686-mingw32/4.6.1/lto-wrapper
Target: i686-mingw32
Configured with: ../configure --build=i686-pc-linux-gnu
--host=i686-pc-linux-gnu --target=i686-mingw32
--prefix=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu
--with-gmp=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu
--with-mpfr=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu
--with-mpc=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu
--with-ppl=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu
--with-cloog=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu
--enable-cloog-backend=isl --enable-threads=win32 --enable-tls
--enable-languages=c,c++
--with-sysroot=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu/i686-mingw32
--disable-win32-registry --enable-sjlj-exceptions --disable-libstdcxx-pch
--with-host-libstdcxx='-lstdc++ -lsupc++'
Thread model: win32
gcc version 4.6.1 (GCC)

I think I should use
  extern template class INTERFACE A<int>;
in A.h, and then
  template class A<int>;
to explicitly instantiate it in A.cpp.

Is my use of "extern template ..." right - in the meaning that I should specify
the attributes there? Does the warning "type attributes ignored after type is
already defined" just wants to protect me of having instances of the same type
with different attributes in one translation unit (if that is even possible)?

In general (not 100 % related to my problem) "extern template ..." would also
help me to have the same attributes on the type, if I used it in other
translation units as well - I could think that it makes problems (which version
should the linker use?) while linking if there are template instantiations with
different attributes (I got this enlightenment from bug #38175) - have I
understood this correctly?

Then since I should probably use "extern template ...", what should I do about
the undefined reference to the typeinfo? Could this be related to bug #21243?

Thank you,

Martin


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (6 preceding siblings ...)
  2011-08-16 13:36 ` ml@convergent-it.at
@ 2011-08-16 14:17 ` redi at gcc dot gnu.org
  2011-08-16 14:18 ` ml@convergent-it.at
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2011-08-16 14:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-08-16 14:00:12 UTC ---
(In reply to comment #0)
>   - When using "extern template..." there is something wrong with exporting the
> symbols for the typeinfo (i686-mingw32-nm shows that they are in the dll, but
> it seems that they are not exported).

what exactly does nm show?

what happens if you put INTERFACE on the class template definition instead of
the instantiation:

template<class T>
class INTERFACE A : public Base
...


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (7 preceding siblings ...)
  2011-08-16 14:17 ` redi at gcc dot gnu.org
@ 2011-08-16 14:18 ` ml@convergent-it.at
  2011-08-16 14:24 ` ml@convergent-it.at
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-16 14:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #9 from Martin Lederhilger <ml@convergent-it.at> 2011-08-16 14:17:32 UTC ---
Results for:

template<class T>
class INTERFACE A : public Base
...

Case one without "extern template": warning is still there but links fine.
Case two with "extern template": still undefined reference to `typeinfo for
A<int>'

I should note that I cannot use INTERFACE on the class template definition,
because I want to explicitly instantiate the template in multiple DLLs and then
I would need dllimport and dllexport at the same time on the class template
definition. For example instantiate A<int> in A.dll, and A<float> in B.dll:
When I want to use A<int> and A<float> in B.dll then I would need dllimport and
dllexport at the same time. Thats why I want to apply INTERFACE to "extern
template INTERFACE...".

Output from nm for case two (with "extern template...") generated by
i686-mingw32-nm dll.dll | i686-mingw32-c++filt > nm.txt


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (8 preceding siblings ...)
  2011-08-16 14:18 ` ml@convergent-it.at
@ 2011-08-16 14:24 ` ml@convergent-it.at
  2011-08-16 15:33 ` ml@convergent-it.at
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-16 14:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #10 from Martin Lederhilger <ml@convergent-it.at> 2011-08-16 14:18:38 UTC ---
Created attachment 25023
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25023
Output of i686-mingw32-nm for dll.dll


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (9 preceding siblings ...)
  2011-08-16 14:24 ` ml@convergent-it.at
@ 2011-08-16 15:33 ` ml@convergent-it.at
  2011-08-18 12:36 ` ml@convergent-it.at
  2012-02-02 21:01 ` ktietz at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-16 15:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #11 from Martin Lederhilger <ml@convergent-it.at> 2011-08-16 14:47:08 UTC ---
Created attachment 25024
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25024
Export table of the dll.

This is a part of i686-mingw32-objdump's output.

Contains the export table of the DLL for the following combinations:
with/without extern template and
with/without INTERFACE on the class template definition


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (10 preceding siblings ...)
  2011-08-16 15:33 ` ml@convergent-it.at
@ 2011-08-18 12:36 ` ml@convergent-it.at
  2012-02-02 21:01 ` ktietz at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: ml@convergent-it.at @ 2011-08-18 12:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

--- Comment #12 from Martin Lederhilger <ml@convergent-it.at> 2011-08-18 12:27:50 UTC ---
For the case with using "extern template...":

If you look at bug #40068, you can see that there was a similar problem (not
exported typeinfo to DLL) once - for normal classes. There were two solutions,
one in comment 1 (has not been applied to GCC) and another in comment 4 (has
been applied to GCC).

If I apply the patch of comment 1, then my problems with the not exported
typeinfo disappears;)

It would be nice, if someone with more knowledge than me can have a look at
this (and how it could be applied to GCC).

Thanks


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
  2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
                   ` (11 preceding siblings ...)
  2011-08-18 12:36 ` ml@convergent-it.at
@ 2012-02-02 21:01 ` ktietz at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: ktietz at gcc dot gnu.org @ 2012-02-02 21:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ktietz at gcc dot gnu.org
         Resolution|                            |DUPLICATE

--- Comment #13 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-02-02 21:00:41 UTC ---
Yes, this is a dup of bug #40068.

*** This bug has been marked as a duplicate of bug 40068 ***


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-02-02 21:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-11 13:36 [Bug c++/50044] New: Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred ml@convergent-it.at
2011-08-11 13:38 ` [Bug c++/50044] " ml@convergent-it.at
2011-08-11 13:38 ` ml@convergent-it.at
2011-08-11 13:39 ` ml@convergent-it.at
2011-08-11 13:39 ` ml@convergent-it.at
2011-08-11 13:40 ` ml@convergent-it.at
2011-08-11 13:40 ` ml@convergent-it.at
2011-08-16 13:36 ` ml@convergent-it.at
2011-08-16 14:17 ` redi at gcc dot gnu.org
2011-08-16 14:18 ` ml@convergent-it.at
2011-08-16 14:24 ` ml@convergent-it.at
2011-08-16 15:33 ` ml@convergent-it.at
2011-08-18 12:36 ` ml@convergent-it.at
2012-02-02 21:01 ` ktietz at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).